Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@ON (format 3) - Mark lines with search term

&pagelevel(3)&pagelevel

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
performed.

cols

Contiguous column range to which the search is to be limited.

If the range specification contains only a single column specification, this
indicates the range from the specified column through to the end of the line.
If the first column specification is greater than the line length then the line is
ignored.

If no column range is specified then the column range specified with
@SEARCH-OPTION is used.

ALL

Although it is permissible to specify ALL the specification is pointless since
a record can only be marked once.

F

Only the first hit line in each line range is marked. If F is not specified then
each hit line in each specified line range is marked.

R

This specification is pointless since whether or not hits are found in a line is
independent of the direction of the search.

NOT

A hit is identified if the search term is not present in the specified column
range in a line (negative search).

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
section “Searching with @ON”). It is not permissible to specify
an empty string.

int

Only the intth occurrence of the search term in a line is marked. All values
between 1 and 32768 are permitted for int. The default value for int is 1
byte.

MARK

The hit lines are marked. If the operand is not specified, the hit lines are
assigned the mark 1. If string variables are specified in the search range
then the MARK operand is ignored for these.

m

Number of the mark (1..9). If m is not specified, the hit line is assigned
record mark 1.

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.