CHAPTER 3 ENTERING AND EDITING PROGRAMS

With BASIC-80, you can create new programs by entering statements line by line, or you can access saved programs from disk storage. If you're using ISIS-II BASIC-80, you can use the ISIS-II BASIC-80 Text Editor to alter new or saved instruction lines. RMX/80 BASIC-80 does not have a Text Editor.

The following topics show how to use BASIC-80 programming features and the ISIS-II BASIC-80 Text Editor to aid program development.

Entering Instruction Lines

When you invoke BASIC without specifying a file name, there is no program to run. The system is ready to accept commands or program statements. A statement con- sists of a line number from 0 to 65529 followed by the language elements (program statement, constants, variables, operators, functions, etc.). If you type a line number alone after a line with that number has been entered with text, that line is deleted.

You can enter statements in any order. To review the statements in a program, use the LIST command. It displays the statement in numeric order.

You can have BASIC-80 provide line numbers, starting at a given number, with a given increment, by using the AUTO command. After you enter the AUTO com- mand, BASIC displays the line number and waits for you to enter the statement. When you end the statement with a carriage return (CR), it prints the next line number and again waits. To stop the automatic line numbers, enter a Control-C.

If AUTO generates a line number that already exists in the program, it prints an asterisk (*) after the line number. If you enter a statement, what you enter replaces the existing statement. If you enter a Control-C, the existing line is unchanged.

You can use Control-I as a tab key if you want to format your statements. The width of each line is divided into 8-character-wide columns. Each time you press Control-I, the cursor or print head moves to the beginning of the next column.

BASIC assumes a width of 72 characters. You can change the width with the WIDTH command.

To enter more than one statement per line, separate each statement with a colon (:). If you want to format the program so that additional statements appear on separate lines (but are still part of the same numbered program statement), use the Line Feed (LF) key to move to the beginning of the next display line. You can do this any number of times, up to the 255-character line-length limit; the program statement doesn't end until you enter CR.

To put a comment in a BASIC-80 'program, enter REM after the line number. BASIC-80 doesn't try to execute such lines, but they become part of the program.

Correcting Entry Errors

If you make an error while entering a line, you can correct it by using the RUBOUT key to erase characters (as long as you haven't entered the line into memory by pressing CR).

3-1

Page 23
Image 23
Intel 9800758-02 manual Entering and Editing Programs