This section defines the various formats which can be used to address lines and line ranges in EDT statements.
Operand | Definition |
lnum | n | fraction | n fraction |
Line number.
Values between 0.0001 and 9999.9999 are permitted for lnum.
Operand | Definition |
inc | lnum |
Increment for line numbers.
Values between 0.0001 and 9999.9999 are permitted for inc.
Operand | Definition |
lsym | lvar | * | % | $ | ? | loopsymb |
Symbolically specified line number which is specified either as a line number variable or as one of the symbols explained below (see also section “Symbolic line numbers”).
| Current line number, i.e. the line number which EDT last wrote to the terminal as an |
| Lowest line number in the file. If the file is empty, Highest line number in the file. If the file is empty or possesses only a single line then |
| Line number of the first hit line resulting from a preceding @ON statement. The value |
The symbolic line numbers *,%,$ and ? always refer to the current work file even if they are used in a range specification for another work file or for an external file. Their values at any given time can be output using the @STATUS statement.
Operand | Definition |
line | {lsym [op inc] | lnum} [op {ivar | nL | lsym}] |
The line operand can be used to specify line numbers directly or as an expression which describes their position relative to other line numbers.
If neither ivar nor nL occurs in the expression specified for line then the line number is calculated as an absolute value, i.e. the line number is determined by adding or subtracting the values of lsym and/or lnum.
If ivar or nL is specified then a logical line number is determined, i.e. the number of existing lines specified by means of ivar or nL are skipped starting from an absolute value, independently of the increment used for line numbering.
In the expression nL, n may not have the value 0. However, it is possible to store this value in an integer variable. It is only possible to assign a logically determined line number if a corresponding line actually exists. Otherwise an error message is output.
Examples
17.1addresses the required line directly and absolutely.If
*=50.1and%=1.0000, then*+3.5-%addresses the line52.6000absolutely.If
%=1.0000and#I15=6, then%+#I15addresses the 6th logical line after line number1.0000(this is not necessarily line7.0000).If
%=1.000, then%+2Laddresses the 2nd logical line after1.0000.If
%=1.0000and*=3.0000, then%+*addresses line4.0000.If
*=50.1and#I5=1, then*+3.5+#I5addresses the line which logically follows line53.6000(this is not necessarily line53.7000).If
*=50.1000, then*+3.5+6Laddresses the 6th logical line after53.6000.
Operand | Definition |
lines | rangesymb | line[[.] - [.] line] |
A contiguous line range.
Specifying line1-line2 (e.g. 1-10) has the same effect as line2-line1 (10-1). If only one line operand is specified then the line range consists of only this one line.
The rangesymb operand represents the range symbol which can be declared by means of the @RANGE statement. The default setting is the character '&' and the range 0.0001 - 9999.9999.
Since the minus sign can both be used as a symbol for defining range limits and occur with its arithmetical meaning in the line expression, ambiguous cases may arise. The following conventions help overcome this problem:
If the first range limit ends with
lsym, then the correct notation islsym.-line.If the second range limit starts with
lsym, then the correct notation isline-.lsym... orline-.lsym op...
Specifying . (period) makes it clear that the expression describes a range and not a difference. The figure 0 can be entered instead of a period. Unlike in svars, the period may only be entered in the specified cases here.
Examples
1-10specifies the lines 1 to 10.%.-5selects the range from the 1st line in the file through to line 5.%+5L-.$-10Lselects the range from the 6th line in the file through to the 10th line before the end of the file.%.-$specifies the entire file.*+2.1-?.-.%+5Lexpresses the range*+2.1-?through to the 6th line of the file.#L1.-#L2designates the range from#L1to#L2.12.011selects only the line12.011.#L9selects only the line whose number is stored in#L9.