Open System Testing Architecture

TOC PREV NEXT INDEX



~EXTRACT Command

Description:

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

If the string identified by the offset and length overlaps the end of the source string, only the characters up to the end of the source string will be returned.

If the offset does not lie within the bounds of the source string when the script is executed, 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.

Format:
 ~EXTRACT (offset, length, string)
Return Value:

The character substring extracted from the source string.

Parameters:
offset

An integer variable or value defining the offset in the source string of the first character that is to be extracted. The first character of the source string is at offset zero.

length

An integer variable or value defining the number of characters to extract to form the substring.

string

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

Example:
 SET NameCode = ~EXTRACT (0, 4, Name) + RunningNo

See also:

Output Stream Handling Commands


OpenSTA.org
Mailing Lists
Further enquiries
Documentation feedback
CYRANO.com
TOC PREV NEXT INDEX