![]() |
*IF Test Condition
The *IF %OUT condition is satisfied if the search string is found in the WRTRD output segment. If this is the case, the command specified, cmd, will be executed. In addition, a pointer, %PTR, will be set to the end of the search string found in the output text. The pointer can then be used to assign a substring to a procedure variable.
Example: *IF %OUT=L'search item found and replaced' &COUNT=%PTR(1,7)
Specifying (1,7) after %PTR will be interpreted as offset and length operands for the assignment of a procedure variable. An offset of 1 flags the first position after the last search item column.
(%PTR) Following an *IF %OUT statement, a search will be made in the output text for the string specified in srch, as from the column in which the last search argument was found.
srch single or multiple search argument in the format 'string' | L'string' | A'string' | X'string'.
It should be noted when entering a search string in the form 'string' that lowercase letters will be converted to uppercase.
If L'string' is specified, no case conversion will take place.
If A'string' (Any) is specified, the case of both the search string entered, as well as the text being searched, is irrelevant, with all text being converted to uppercase before the comparison.
Multiple search arguments can be entered, linked with + (AND) / , (OR) / * (Wildcard) operators.
cmd CFS procedure language statement. The asterisk that normally prefixes procedure statements must not be included.
A full description of the search statements can be found on pages 8- and 8-.
Example:
The following procedure will prevent the user from reaching the CFS Selection mask by pressing the K1 key. Refer to page 19- for information regarding the ON %OUT statement.
.ON-IN
*ON %IN=K1 SKIP .TEST-MASK The mask contents following K1 are tested
*DIA
*EXIT
.TEST-MASK
*IF %OUT='FILENAME-SELECT :' SKIP .INPUT-NO
*SKIP .ON-IN
.INPUT-NO
NO
*SKIP .ON-IN