The @ON statement searches only in the specified search range.
Here, it is possible to specify one or more line ranges. A line range can also consist of just a single line. The line ranges are searched through in the specified order. It is also possible to specify a range of string variables for a line range.
An operand can be used to specify whether in each specified line range, the @ON statement identifies only the first hit line or searches through all the lines in the line range. By default, the @ON statement searches in all the lines in each specified line range.
Examples
@ON 1-3 FIND 'ABC'
In the @ON statement, only a single line range is searched.
@ON 1,2,3 FIND 'ABC'
The search range consists of three line ranges consisting of one line each. Depending on the operands, the search result may be different from in the preceding example.
@ON #S01,#S03.-#S04 CHANGE 'ABC' TO 'DEF'
In the @ON statement, the string variables #S01
, #S03
and #S04
are searched for a hit.
A column range can be specified for a search in a line. It is not permissible to specify multiple column ranges. If no column range is specified then a default column range is used (see @SEARCH-OPTION).
Examples
@ON &:15-15: CHANGE 'A' TO 'D'
In the @ON statement, only a single column is therefore examined.
@ON &:15-25: PRINT 'XYZ'
In the @ON statement, only a contiguous column range is therefore searched.