F$LOCATE()
Revision as of 09:07, 18 December 2018 by Darya.zelenina (talk | contribs) (Created page with "'''F$LOCATE()''' is a lexical function that locates a specified portion of a character string and returns as an integer the offset of the first character...")
F$LOCATE() is a lexical function that locates a specified portion of a character string and returns as an integer the offset of the first character.
Format
F$LOCATE(substring,string)
Substring is the portion of the string that needs to be located. String is the string where the substring should be located.
Examples
Find out the length of the filename by locating the dot character:
$ FILE_SPEC = "MYFILE.DAT;1" $ NAME_LENGTH = F$LOCATE(".",FILE_SPEC)
Find out if a user is disusered by analyzing the line that contains the user's account flags:
$ line = "Flags: PwdMix" $ if f$locate("DisUser",line) .nes. f$length(line) then write sys$output "Disusered"