Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Recording a hit

&pagelevel(4)&pagelevel

EDT records the results of the search for hits in local switches or in variables.

@IF (format 3) can be used to query whether a hit was identified the last time the @ON statement was run or whether the current work file was empty. If a hit was recorded, it is also possible to query the number of the column in which the first hit string starts.

In addition, EDT records the results of the search operation in accessible variables.

The number of the line in which EDT identified the first hit is recorded in line number variable #L0 and under the line number symbol '?'. If no hit is found or if the hit is identified in a string then the values of #L0 and '?' remain unchanged.

The number of the column in which the search term begins on the first identified hit (independently of whether this is a line or a string variable), is stored in the integer variable #I0 and the number of the column in which it ends in the integer variable #I1.
If no hit is found, the values of #I0 and #I1 remain unchanged.
This also applies to hits found in a string variable.
@PRINT #L0:#I0-#I1 can be used to output the hit string on screen if the hit was located in a line. If the operands V and ALL are specified then the number of hit lines or the number of string variables which contain the search term is stored in the integer variable #I2 and the total number of hits is stored in the integer variable #I3.
Independently of the specified character set, column specifications designate character and not byte addresses.

In the case of a negative search, following the occurrence of the first record in which the search term does not occur, the start position of the searched column range is recorded in integer variable #I0 and the end position in integer variable #I1.

If the end position of the column range is greater than the record length then the record length is stored in #I1.

Example

The work file contains a line with the string ’XXX-ABCD-YYY’.

Search term

Hit string

Content of #I0 and #I1

’ABC*Y“

ABCD-YYY

#I0 = 5; #I1 = 12

’ABC*Y’

ABCD-Y

#I0 = 5; #I1 = 10

"ABCD’

ABCD

#I0 = 5; #I1 = 8

’*BCD’

BCD

#I0 = 6; #I1 = 8