Entering Text and Commands in Page Mode

A whole page of text is transmitted to CANDE when the cursor is placed at home position (the upper left-hand corner of the screen) or at the end of the last line of text on the page and the XMIT (transmit) key is pressed. NEXT must always be the first token on the screen for text to be transmitted in page mode. When a page is transmitted that does not contain any CANDE commands other than VOID, a new page is displayed that begins with the last line transmitted. When the XMIT key is pressed, CANDE receives everything between the home position and the cursor if the cursor is not at home position.

When the NEXT command is used as the page-invoking command, any records that are transmitted with the NEXT command are marked as changed or new records. If MARKID is set, the MARKID fields of these records are updated.

After CANDE displays a page, this page can be edited and transmitted with the changes made.

CANDE maintains a copy of the most recently displayed page. This page copy is compared to the edited page CANDE receives so that the modified existing records and the newly added records are identified.

If CANDE receives a different page than the page most recently sent by CANDE, each of the records received could be marked by CANDE as a new or modified record to the work file, particularly when a MARKID value is set. Therefore, avoid transmitting a different page.

The SAME command can be used to display the most recently displayed page.

Setting WRAPAROUND for Screen Display

The setting of WRAPAROUND, which can be checked and modified by the TERMINAL command, affects how lines of text are ended. If WRAPAROUND is set to FALSE, each line of text ends with a carriage return and linefeed so the text can be displayed on the screen properly. If WRAPAROUND is set to TRUE, the terminal automatically does a linefeed and carriage return.

Transmitting Records in Page Mode

Records must be transmitted in sequential order or a sequence error is flagged and record processing stops. The following message is given when the end of the file or the end of the sequence range requested by a page-invoking command has been reached:

#DISPLAY COMPLETE

Records can be inserted between the records given by CANDE. The sequence field can be left blank if a record prior to these inserted lines has a sequence number. CANDE calculates the sequence numbers for these inserted lines, and the largest sequence increment allowing all records to be numbered is assigned. The increments considered are 100, 50, 20, 10, 5, 2, and 1.

If the records do not fit when the minimum increment of 1 is used, a message is displayed. Under certain conditions, an error message might be displayed although there is sufficient room for the inserted lines. Refer to the examples later in this section for an explanation of how this can occur.

Assigning Sequence Numbers to Records

Sequence numbers can be assigned to records manually if the sequence is within the range of the numbered records.

Leading zeros of sequence numbers can be replaced by blanks if desired. For example, if b signifies a blank space, 00000100 can be typed as bbbbb100. Unnumbered blank lines transmitted at the bottom of the page are ignored. However, if blank lines are desired at the bottom of the page, a sequence number or a command must be typed on the last of the blank lines.

Using CANDE Commands in Page Mode

Any valid CANDE command can begin in the first column of any line within the currently displayed page. However, transmitting any commands, except the VOID command, interrupts page mode.

CANDE processes page mode input record by record until a command other than VOID is found. At this point CANDE processes the remaining text on the screen as a command or string of commands separated by semicolons or carriage returns.

If a CANDE command followed by additional page mode text is transmitted, an error message is given. The cursor should be located immediately after the command when it is transmitted.

Returning to Page Mode After Processing a CANDE Command

To return to page mode after processing commands other than VOID or a page mode command, one of the page-invoking commands must be used.

CANDE keeps track of the most recently displayed page of text as a location in the work file. When page mode is temporarily interrupted to process a nonpage-invoking command, the page-invoking commands can be used to return to page mode at that displayed page (SAME) or near it (NEXT, PAGE, + or –).

It should be noted that these commands are always performed relative to the previous page mode command entered. For a better understanding of this behavior, see the examples that follow later in this section.

CANDE maintains the current (or most recently) displayed page after the execution of all other CANDE commands, with the exception of one group. This group consists of the following commands, other than SAVE, that finalize the state of the work file: REMOVE, GET, MAKE, RECOVER, MCS, BYE, and HELLO.

The asterisk (*) form of the FIX command and the at sign (@) form of the MARGIN command cannot be used within numbered lines while in page mode. (This differs from single-line sequencing mode.)

Page mode input is processed only when the next UPDATE, LIST, or any page-invoking command is entered. Because of this, an error message may not be displayed at the time page mode input is transmitted.

Examples

In the following example (an ALGOL file), the XMIT key should be pressed when the cursor is in the last column of line 2400. Line 200 is deleted and a new page that begins with the sequence number 2400 is displayed.

NEXT+....*....1....*.......* ....6....*....7..
00000100 ABC
00000200 DEF<This line will be deleted.>
00000300 GHI
.....
.....
.....
00002400 JKL

In the following example, the FIND command is executed after lines 100-300 are processed, if the cursor follows the FIND command when XMIT is pressed:

NEXT+....*....1....*.......* ....6....*....7..
00000100 ABC
00000200 DEF<This line will be deleted.>
00000300 GHI
FIND LIT /ABC/ :TEXT

In this example, the cursor should be placed in the first column immediately following line number 300. As a result, a new page that begins with the sequence number 2400 is displayed.

NEXT+....*....1....*.......* ....6....*....7..
00000100 ABC
00000200 DEF
00000300 GHI
.....
.....
00002400 JKL
00002500 QWE
00002600 TYU

In this example, the cursor should follow the NEXT+ command typed after line 300. As a result, a new page that begins with the sequence number 2400 is displayed.

NEXT+....*....1....*.......* ....6....*....7..
00000100 ABC
00000200 DEF
00000300 GHI
NEXT+
.....
.....
00002400 JKL
00002500 QWE
00002600 TYU

The delay between transmitting a command and receiving an error message about that command is demonstrated in the following example:

NEXT+....*....1....*.......* ....6....*....7..
00001000 ABC
00002000 DEF
00003000 GHI
         JKL
00003001 JKL
DELETE 4000-END

Upon the next UPDATE, LIST, or page-invoking command, the following error message is given:

#CANNOT SEQUENCE WITHIN BOUNDS AT LINE 5

Notice that LINE 5 refers to the fifth line transmitted, the line with NEXT being the first line transmitted.

The following example demonstrates how using a non-page-mode command (DELETE, in this example) while in page mode, and then entering unsequenced lines before using a page-invoking command to return to page mode, can cause CANDE to calculate sequence numbers incorrectly (the file type shown is ALGOL).

The PAGE command, entered on page 1 of the terminal, returns the following screen:

NEXT+....*....1....*.......* ....6....*....7..
00000005 ABC
00000010 DEF
00000012 GHI
00000014 JKL
00000025 MNO

After moving to page 2 of the terminal, the following command is entered:

DELETE 12

Then, moving back to page 1 of the terminal, the following screen is transmitted when you attempt to enter three unsequenced lines between lines 10 and 14, without first entering a page-invoking command (PAGE or SAME) to return to page mode:

NEXT+....*....1....*.......* ....6....*....7..
00000005 ABC
00000010 DEF
         XXX
         YYY
         ZZZ
<XMIT from here>

CANDE returns the error message:

#CANNOT SEQUENCE WITHIN BOUNDS AT LINE 4.
LAST VALID SEQUENCE=10

Even though line 12 was deleted, since no page-invoking command was subsequently entered, the page mode tables were not updated with the deletion. Therefore, CANDE attempted to place the new unsequenced lines between line 10 and the next known line, which it had saved internally as line 12. The sequence error message was generated because CANDE could not fit three unsequenced lines between lines 10 and 12.

Note: If a command is included in the transmission (after the page-mode input), there could be a delay between transmitting the screen and receiving an error message. This is illustrated in a previous example.

If PAGE or SAME had been entered upon returning to page 1 of the terminal, the page mode tables would have been correctly updated with the deletion, and there would have been sufficient room for the new lines.