LOCATE Integer FunctionThis command is an Integer Function and can only be referenced within a SET command. It returns an integer value, corresponding to the offset of the specified substring in the source string. By default, the matching is case sensitive. The strings "OpenSTA" and "opensta", for example, would not produce a match, because the case of the characters is not the same. This can be overridden by specifying the CASE_BLIND clause. The source string is scanned from left to right. If the substring appears more than once in the source string, the function will always return the offset of the first occurrence. Function Definition:~LOCATE(substring, string) {,CASE_BLIND} Returns:The integer offset of the substring in the source string. The offset of the first character in the string is zero. If the substring is not found a value of -1 is returned. substringThe character variable or quoted character string defining the string to be scanned for in the string. stringThe character variable or quoted character string to be scanned for the specified substring. Example:SET Offset = ~LOCATE(Separator, Test), CASE_BLIND |
|
<<< prev page |
^^^ section start |
>>> next page |
Proud to be Open, prouder to be Free |
OpenSTA SCL Reference, version 2.0.6 Copyright & License Info on ToC page |
Last Updated: 2005-05-11 |