── SEQ ─┬────────┬─┬────────────┬─┬─────────────────┬──────────────────┤ ├─<base>─┤ └─ + ──<inc>─┘ └─ : ─┬─ PAGED ───┤ ├─ NEXT ─┤ └─ UNPAGED ─┘ └─ END ──┘
Explanation
The SEQ command causes the system to automatically provide a sequence number for each line to be entered in the work file. Sequencing is done either in single-line sequencing mode (UNPAGED) with one line number presented at a time, or in page-mode sequencing (PAGED) with a whole page of numbered lines presented. The default setting for SEQ on screen terminals capable of page mode is PAGED, while nonscreen terminals have only single-line sequencing (UNPAGED) available.
The SEQ command can be used either when a file is created or while editing a pre-existing file. When a file is created, SEQ provides sequence-numbered lines with a specified base and increment on which to enter text. While editing a pre-existing file, SEQ can be used to provide additional numbered lines at the end of the work file (SEQ with the UNPAGED option, SEQ NEXT with the PAGED option), or it can be used to insert lines at a newly specified base and increment, within the preexisting text (see the second example under PAGED at the end of this command description).
The following paragraphs, with the exception of those captioned PAGED and UNPAGED, apply to both single-line sequencing mode and page mode sequencing.
The starting line number can be specified in one of four ways, as defined in the following paragraphs:
The SEQ command without <base>, NEXT, or END gives a beginning line number of 100 when beginning a new file. When adding to an existing file, SEQ without <base>, NEXT, or END always displays line 100 for the PAGED option. For the UNPAGED option, SEQ used without <base>, NEXT, or END works the same as SEQ NEXT (described further on).
<base>
The <base> construct explicitly defines the starting line number.
NEXT
The NEXT option sets the starting line number to the next line number that would have resulted from the last SEQ, RESEQ, MOVE, or INSERT command. If none of these commands have been issued, then 100 is used.
END
The END option sets the starting line number to the largest line number in the work file plus the specified (or default) increment. If no specifications appear, 100 is used as the increment.
<inc>
The <inc> value specifies an increment to be used in generating subsequent line numbers. 100 is the default unless an increment has been specified in a prior SEQ, RESEQ, MOVE, or INSERT command.
PAGED
The PAGED option applies only to SCREEN terminals with the minimum of PAGESIZE and MAXOUTPUT/LINEWIDTH greater than two lines. The MAXINPUT must be greater than or equal to the smaller of MAXOUTPUT, and PAGESIZE*LINEWIDTH. PAGED is the default for terminals with these characteristics. If PAGED is used on a terminal that does not have these characteristics, an error message is given. The TERMINAL command in this manual lists the MAXOUTPUT, LINEWIDTH, and MAXINPUT.
The PAGED option sends a page with sequence numbers at the left of the screen to the user. NEXT and a column indicator appear at the top of the screen and the user can enter and transmit data back to CANDE one page at a time. If no command other than VOID is transmitted within the page, CANDE sends a new page of sequence numbers that begins with the last record from the previous page.
The SEQ command with the PAGED option puts page-mode-capable terminals into page mode sequencing. CANDE sends the user a page with sequence numbers at the left of the screen, as described above. The shortened versions of the MARGIN and FIX commands, which can be inserted within a line with single-line sequencing, cannot be used with page mode. Any command, with the exception of VOID, transmitted after a SEQ command automatically stops page mode sequencing.
This is unlike single-line sequencing mode (the UNPAGED option) where the only way to send a command is to first break the sequence by sending a null input. See also UNPAGED in this section for more information.
If one or more commands are transmitted within the page, sequencing is discontinued and the commands are executed. The SEQ NEXT form resumes sequencing where it left off. Transmitting SEQ alone gives a numbered page of text beginning with line number 100. This result is different from the result of transmitting SEQ alone using the UNPAGED option. For more information about page mode commands, refer to Page Mode Operations.
UNPAGED
The UNPAGED option is the default for non-SCREEN type terminals (a type declared in NDLII that can be modified by the TERMINAL SCREEN/HARDCOPY command) and for SCREEN type terminals that do not have the capability of page mode. SCREEN type, page-mode-capable terminals can use this option to initiate single-line sequencing mode.
If the UNPAGED option is specified, single-line sequencing is invoked and the system recognizes only the commands that begin with the defined control character of the station (control commands) and a special adaptation of the MARGIN and FIX commands; all other information is treated as text. Single-line sequencing continues until you press the ETX key at the terminal's home position followed by the XMIT key. (On non-TD terminals, you press the RETURN key.) Pressing the keys sends a null line. Refer to the MARGIN and FIX commands in this section for a complete description of these commands.
In single-line sequencing mode on a teletype or similar device, the new line number is typed at the beginning of each line; the text desired for that line is then entered. On devices with multiline input capability, the lines must be separated with carriage returns. A new sequence number is displayed after each transmission; the line number is incremented but not displayed for subsequent lines within a transmission block.
Normal CANDE commands are not recognized in single-line sequencing mode because they are indistinguishable from text entries. If the line begins with the defined control character, usually a question mark (?), the input is processed as a control command. If the defined control character is to be entered as the first character of a line in sequence mode, the line must be preceded by an extra control character. That is, the control character must appear twice (??) if it is to be entered as the first character. This also applies to the asterisk (*) and at sign (@).
Although sequence numbers are generated, the line is otherwise treated as a single-line entry. That is, if the new line number matches one in the work file, the newer line replaces the older. This can result in accidentally overwriting existing lines. The SEQ END command always adds new lines to the end, but the SEQ NEXT command might overwrite lines.
Different types of terminals may act differently in single-line sequencing mode; therefore, the user should learn the characteristics of the particular terminal to be used.
Examples
PAGED
In the following example, page mode sequencing using the PAGED option is displayed. The following page of line numbers is presented to the user simultaneously. (This is a sample with an ALGOL file.)
SEQ 20 + 10 NEXT+ ....*....1....*....2....*....3 00000020 00000030 00000040 00000050 . . . 00000250
Occasionally, the user may want to insert blank lines into a set of records. In the following example, records with sequence numbers 100, 110, 120, 200 and 300 already exist.
SEQ 50 + 50 NEXT+ ....*....1....*....2....*....3 00000050 00000100ABC 00000110DEF 00000120GHI 00000150 00000200JKL 00000250 00000300MNO . . . 00001150
UNPAGED
In the following examples, single-line sequencing mode using the UNPAGED option displays the following lines one at a time:
S 100YOUR STATEMENTS 2005 300TEST COLUMNS 400 # L 100 YOUR STATEMENTS 200 TEST COLUMN # seq 10+3 10 your statements.... 13 and so on.... 16 and so on.... 19 #