OpenSTA logo OpenSTA SCL Reference
LOCATE Integer Function

LOCATE Integer Function

This 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.

substring

The character variable or quoted character string defining the string to be scanned for in the string.

string

The 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