This format of the @ON statement causes all records in which a hit is identified to be flagged with the specified record mark. In F mode, the work window is positioned at the first hit record.
Operation | Operands | F mode, L mode |
@ON | { lines | svars } [,...] [:cols[:] ] F IND [ A LL] [ F ] [ R ] [ NOT ] [ P ATTERN] search [,int] [MARK [m] ] |
lines svars | One or more line ranges in which the search is to be performed. One or more ranges of string variables in which the search is to be |
cols | Contiguous column range to which the search is to be limited. If the range specification contains only a single column specification, this If no column range is specified then the column range specified with |
ALL | Although it is permissible to specify |
F | Only the first hit line in each line range is marked. If |
R | This specification is pointless since whether or not hits are found in a line is |
NOT | A hit is identified if the search term is not present in the specified column |
PATTERN search | The wildcards present in the search term are interpreted. Search term that is to be searched for in the search range (for details, see |
int | Only the |
MARK | The hit lines are marked. If the operand is not specified, the hit lines are |
m | Number of the mark ( |
Any existing record marks (e.g. those set by previous @ON statements) are retained.
If the statement is used for a file opened for real processing with @OPEN (format 2) then no records are marked. In F mode, the work window is simply positioned at the first hit record. The explicit specification of MARK
or MARK m
is rejected with the error message EDT4935
.
If the statement is interrupted with [K2] and the EDT session is continued with /INFORM-PROGRAM
then the processing of the statement is aborted and message EDT5501
is output.
Note
The statement @ON lines FIND NOT PATTERN '/'... can be used to specifically mark empty lines (records of length 0) if '/'
is the wildcard that stands for precisely one character.
Example
The records which contain the search term STR
. should be flagged with record mark 2. EDT automatically moves to the 1st hit record.
The work window has been positioned at line 3 since this contains the first hit record.
+(2)
is specified to scroll to the next record with record mark 2.