Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Lines and line ranges

&pagelevel(4)&pagelevel

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
acknowledgment in L mode. If the file is empty, * has the value 1.

%

$

Lowest line number in the file. If the file is empty, % has the value 1.

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
when EDT starts is 0. This can only be modified by a successful @ON statement.
Following an @ON, the symbolic line number ? therefore has the same value as #L00.

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.1 addresses the required line directly and absolutely.

  • If *=50.1 and %=1.0000, then *+3.5-% addresses the line 52.6000 absolutely.

  • If %=1.0000 and #I15=6, then %+#I15 addresses the 6th logical line after line number 1.0000 (this is not necessarily line 7.0000).

  • If %=1.000, then %+2L addresses the 2nd logical line after 1.0000.

  • If %=1.0000 and *=3.0000, then %+* addresses line 4.0000.

  • If *=50.1 and #I5=1, then *+3.5+#I5 addresses the line which logically follows line 53.6000 (this is not necessarily line 53.7000).

  • If *=50.1000, then *+3.5+6L addresses the 6th logical line after 53.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 is lsym.-line.

  • If the second range limit starts with lsym, then the correct notation is line-.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-10 specifies the lines 1 to 10.

  • %.-5 selects the range from the 1st line in the file through to line 5.

  • %+5L-.$-10L selects 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-?.-.%+5L expresses the range *+2.1-? through to the 6th line of the file.

  • #L1.-#L2 designates the range from #L1 to #L2.

  • 12.011 selects only the line 12.011.

  • #L9 selects only the line whose number is stored in #L9 .