C+ C NAME: C LocFirst C PURPOSE: C Find the first occurrence of string cFnd in string cStr C CALLING SEQUENCE: function LocFirst(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 occurrence, or C 0 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 LocFirst will return 0 instead. C MODIFICATION HISTORY: C JUL-1995, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- character cFnd*(*) character cStr*(*) LocFirst = 0 if (len(cFnd) .eq. 0) return ! index(cStr,cFnd(:0)) = 1 LocFirst = index(cStr,cFnd) return end