Although BASIC09 has several functions or modes, they all work together to make programming as simple as possible. The easiest way to learn how BASIC09 and its functions operate is to write and run a program. This chapter provides sample statements and instructions to help you learn how to use BASIC09.
To create and execute a program:
To begin the program, execute BASIC09. To be sure you have enough room in which to work, reserve a workspace of 10,000 bytes by typing:
The BASIC09 system mode prompt, B:, appears after the copyright message. In the system mode, you can do such things as save and load procedures, change workspace size, and rename and delete procedures.
To write procedures, you must be in the edit mode. You get there by typing:
This causes the screen prompt to change to E:, and the screen displays:
Because you didn't give a program name when you entered e, BASIC09 selects the name Program for you. Now, you must write the code to make Program do something.
There are two responses you can give at the edit mode prompt. You can type an edit command, or you can type a program line. If you type a program line, you must type a space as the first character in the line. If you type an edit command, do not precede it with a space. To make listings easier to read, this manual uses the symbol 0 to indicate spaces before every line. It also uses the 0 symbol in some procedure lines to indicate the correct number of spaces needed. Whenever you see either a space or a 0 symbol in a procedure you are typing, press the space bar.
To type the procedure in this chapter, begin each line at the E prompt. After typing a line, check it for mistakes. If you make a mistake, use F±:) to move the cursor back. Correct the mistake. Then, type the remaining portion of the line. If there are no mistakes, press ENTER .
BASIC09 checks each line when you press ENTER . If you make a mistake in syntax or form, BASIC09 displays an error message. An arrow points to the place in the program line where the error occurred, and a message number indicates the type of error Refer to Appendix A for an explanation of the error codes.
If, after you enter a line, you find that you made a mistake, type d ENTER to delete the line. Then, retype the line. Later, the manual tells you how to change text in existing lines.
The following program helps you do a bit of arithmetic. To get a feel for BASIC09, type and execute the program as directed. Remember, when you see either a space or 0, press the space bar.