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 8) - Delete hit string

&pagelevel(3)&pagelevel

If a hit is found then this format of the @ON statement deletes the hit string when the line content or string variable is being searched through. In this case, the remaining content of the work file lines or string variables is retained.

Operation

Operands

F mode, L mode

@ON

{ lines | svars }  [,...] [:cols[:] ] D ELETE [ A LL] [ F ] [ R ] [ P ATTERN]

search [,int]

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 or
string variable is ignored.

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

ALL

All the hit strings in a line are deleted. If ALL is not specified then only the
first hit string in a line is deleted.

F

In each specified line range, hit strings are only deleted in the first line
containing hits. If F is not specified then the hit strings are deleted in each
line in each specified line range.

R

The lines are searched through from right to left. If R is not specified then
they are searched through from left to right.

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 considered to
represent the first hit. Values between 1 and 32768 are permitted for int.
The default value for int is 1 byte.

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.

Example

The lines in the entire work file are to be searched through from right to left for the string XXXYYYZZZ. The first time the search term occurs, the string is to be deleted and the search terminated.

In line 1, the first occurrence of the search term when searching from the right was found starting at column 29.

Next, every occurrence of the search term XXXYYYZZZ is to be deleted throughout the entire work file.