BASIC-SO

Entering and Editing

Complete editing of a line replaces the old line with the edited line. This resets all variables to zero or null. To end editing without losing prior variable values, exit the editing mode with the Q subcommand after the line number has been printed. BASIC-80 returns to command level, variable values are unchanged and any editing changes are lost.

There are three ways to enter the Editing Mode:

1)Type EDIT line number, and BASIC-80 returns the line number requested. If you press the space bar, the cursor moves to the desired location in the instruc- tion line.

2)When entering text, type a Control A instead of a carriage return. This causes a carriage return, a space, and the computer prints an exclamation point. The cur- sor points at the first character of the sequence, and can be advanced by press- ing the space bar. If you use CONTROL-A after listing a program, it edits the last line, and you can't change line numbers.

3)If BASIC-80 encounters an instruction line with a syntax error during program execution, it will halt and print an error message of the format: SYNTAX ER- ROR IN (line number). Below the error message, the computer returns the line number, and the line may be edited.

In the Edit Mode, pressing RUBOUT will echo characters, but they are not deleted. Use the D subcommand to delete characters ,in the Edit Mode.

In the explanatory sections b~low, a typical line of program text is edited and re-

edited by each subcommand. The " . " indicates the position of the cursor or print head, and all characters are shown as they appear on the terminal. Such editing sub- commands as D, L, Carriage Return, Escape, and so on are represented in paren- theses: (CR), (ESC), (D), (4SE) to avoid confusion. You should tryout these or other examples to gain facility with the editor.

In the following sequence of edit subcommands, we will be editing line 40 of a hypothetical program. Line 40 returns a syntax error message, since it needs a PRINT instruction following ELSE, and should not contain OR:

40 IF A>B THEN 120 OR ELSE "NULL SET"

D Subcommand

The D subcommand is used to delete characters to the right of the cursor. Spaces are counted as characters. If there are less than n characters to the right of the cursor, just the remaining characters are deleted. The argument n is an integer in the range 1 to 255, and the default value is 1. The deleted characters are printed enclosed by backslashes, i.e., \characters\ .

The syntax of the D subcommand is:

[integer] D

In the example below, line 40 returned a SYNTAX ERROR message when the pro- gram ran. BASIC-SO displays the error message and enters the Edit Mode. By press- ing the space bar, the text of line 40 is displayed character by character until the incorrect character is encountered.

40IF A>B THEN 120 OR ELSE "NULL SET"

40IF A>B THEN 120.

The command( 3D) (press 3, then D) results in:

40 IF A>B THEN 120 \OR\ •

3-3

Page 25
Image 25
Intel 9800758-02 manual Subcommand, Integer D, Command 3D press 3, then D results, If AB then 120 \OR