30 P. "Number " ; choice; "!"

40 P."A good selection! "

Now LIST the program -- abbreviations used in program lines are expanded to

their full length automatically when a program is listed.

The abbreviations for all BASIC keywords are given in Appendix 6.

Using the function keys

Most of the keys on the keyboard print a particular character whenever they

are pressed. Across the top of the keyboard are a group of red keys which act

differently. They are called the function keys. Each key can be programmed

to produce a character or string of characters when it is pressed.

For example, you can program f0 to to produce the word PRINT by typing:

*KEY0 PRINT RETURN

f1 can be programmed to produce INPUT if you type:

*KEY1 INPUT RETURN

Now press f0 and f1 to see the effect You will notice that after the

characters have been printed the cursor remains at the end of the line.

Sometimes it is useful to program a function key so that it behaves as if RETURN

had been pressed after the characters are printed and this is achieved by

including the characters | M in the key definition. For example:

*KEY2 LIST |M RETURN

causes the current program to be listed whenever f2 is pressed. Some screen

modes only print 20 characters per line, which makes a listing very difficult to

read; so it would probably be better to define f2 so that the computer

switches to mode 135, the most readable mode, before listing a program:

*KEY2 MODE 135: MLIST |M RETURN

It is useful to write a brief program that defines the keys. This program can be

loaded and run at the start of a computing session. The key definitions remain

set until:

-- the keys are redefined;

-- a *FX18 command is given, which clears the keys;

-- there is a hard break (i.e. CTRL + BREAK

C 10