OpenSTA logo OpenSTA SCL Reference
EXTRACT Character Function

EXTRACT Character Function

This a Character Function and can only be referenced within a SET command. It returns the portion of the string identified by the specified offset and length.

Function Definition:

~EXTRACT(offset, length, string)

Returns:

The character substring extracted from the source string.

offset

An integer variable or value defining the offset in the string of the first character that is to be extracted. The first character of the source string is at offset zero. If the offset is not within the bounds of the source string then a message will be written to the audit log, indicating that a bad parameter value has been specified. Script execution will then be aborted, or the specified action taken if error trapping is enabled via the ON ERROR command.

length

An integer variable or value defining the number of characters to extract to form the returned string. If length specified causes the specified area to overrun the end of the string, only the characters up to the end of the string will be returned.

string

The character value or character variable from which the substring is to be extracted.

Example:

SET Name-Code = ~EXTRACT(0, 4, Name) + Running-No

<<<
prev page
^^^
section start
>>>
next page