The @SEQUENCE statement (format 1) causes EDT to write a number in each line of a contiguous line range.
A predefined number consisting of a maximum of 8 digits (possibly with leading zeros) is written to the first line of the line range. This also defines the number of digits in all the following numbers. All the following numbers are given by the total of the preceding number plus the predefined increment. If this process would result in a number containing more digits than are present in the starting number then only the same number of digits from the right as are present in the starting number are used.
This statement overwrites any content in columns in which the numbers are written.
Operation | Operands | F mode, L mode |
@SEQUENCE | [ {lines | svars} ] [: [col] [: [n1] [(n2)] ] ] |
lines svars | EDT writes a number to each line in the specified line range. EDT writes a number to each string variable in the specified range of string |
col | The operand specifies the column which is to accommodate the first digit of If the |
n1 | This operand specifies the integer value that EDT is to write as a decimal If the |
n2 | This operand specifies the increment (as an integer value) for the formation If the |
If neither the lines
nor the svars
operand is specified then EDT writes a number in every line of the current work file.
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.
Note
The choice of starting value and increment determines whether the sequence of numbers generated by the @SEQUENCE statement (format 1) is ascending, descending or constant. For example, the starting value 0100
and increment 100
result in the ascending sequence of numbers 0100
, 0200
, 0300
, etc., at least up to the value 9900
.
After that, the value reverts to 0000
and numbering continues with 0100
, 0200
etc.
If the starting value 999
is selected in combination with the increment 998
, then the descending sequence 999
, 997
, 995
etc. is obtained. When the value 001
is reached, the next number is 999
again and the sequence repeats from the beginning.
In the example above, the same result could be obtained by setting the increment to 3998
, for example, because the leading 3
is omitted in each newly formed number. An alternating sequence of numbers can be obtained, for example, by setting the starting value 3
and the increment 5: 3
, 8
, 3
, 8
, etc. The easiest way to obtain a constant sequence is to set the increment 0
.