C+ C NAME: C LocFirstLen C PURPOSE: C Find the first occurrence of string cFnd in string cStr C CALLING SEQUENCE: function LocFirstLen(cFnd,cStr) C INPUTS: C cFnd character*(*) string to be searched for C cStr character*(*) string to be searched C OUTPUTS: C L integer position of first/last occurrence, or C len(cStr)+1 if cFnd not found C PROCEDURE: C > The index function has the quirky property that it returns 1 when C searching for a zero-length string, i.e. C I = index('abcd',str(:0)) will set I = 1. C LocFirstLen will return len(cStr)+1 instead. C MODIFICATION HISTORY: C JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- character cFnd*(*) character cStr*(*) !LocFirstLen = index(cStr//cFnd,cFnd) ! Won't work in MS-Fortran LocFirstLen = LocFirst(cFnd,cStr) if (LocFirstLen .eq. 0) LocFirstLen = len(cStr)+1 return end