WHEREIS, WHEREISLAST
9.0
The WHEREIS instruction scans a string for the first occurrence of another string. WHEREISLAST scans the string in reverse order. The instructions use the following format:
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
source
Required. A previously defined Character String Variable, literal, equated character value, or a character value for which to search.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
search
Required. A Character String Variable or Literal whose logical string is searched.
sep2
Optional. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, INTO, or GIVING.
result
Optional. A Numeric Variable that receives the form pointer value in the {search} string where the {source} string was found.
Flags Affected: EOS, OVER, ZERO
Note the following:
The {source} and {search} variables are not changed by the operation of this instruction.
The EOS flag is set TRUE if the {source} or {search} is NULL.
The ZERO flag is set FALSE when the {source} string is found in the {search} variable. If the optional {result} variable is specified, the form pointer value of the located string is stored. The ZERO flag is set if the {source} string is not found in the {search} string.
WHEREIS searches in a forward order. WHEREISLAST (9.1.C) seaches backward.
The OVER flag is set TRUE if {result} is too small to receive the form pointer value.
See Also: Example Code, Character String Instructions
![]() |