This format of the @ON statement causes EDT to delete the content of a work file line or string variable before or after the hit string if a hit is found.
Operation | Operands | F mode, L mode |
@ON | { lines | svars } [,...] [:cols[:] ] FIND [ALL] [F] [R] [PATTERN] search [,int] DELETE { PREFIX | SUFFIX } |
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 | Each time a hit string is found in a line, the text before or after the hit string |
F | In each specified line range, texts are only deleted before or after the hit |
R | The lines are searched through from right to left. If |
PATTERN | The wildcards present in the search term are interpreted. |
search | Search term that is to be searched for in the search range (for details, see |
int | Only the |
PREFIX | The content of the hit line before the hit string is deleted as far as the start |
SUFFIX | The content of the hit line after the hit string is deleted as far as the end of |
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 text preceding the hit is to be deleted before the fourth occurrence of the string ABABAB
('AB'*3,4
) in every line in the entire line range (%.-.$
).
In line 1, the search term was found for the fourth time as a hit starting at column 22.
In line 2, the search term is found as a hit for the first time starting in column 1, for the
second time starting in column 7, for the third time starting in column 13 and for the fourth
time starting in column 19. When searching for the second and subsequent hits, EDT starts
after a hit string each time.