80 A note on LISTO LISTO stands for LIST Option and it is followed by a number in the range 0 to 7. Each number has a special effect and details are given in the BASIC keywords chapter under LISTO . However, the two most useful values are 0 and 7. LISTO 0 lists the program exactly as it is stored in memory. LISTO 1 lists the program with one space after each line number. Most programs in this book have been listed like this. LISTO 7 lists the program with one space after the line number, and two extra spaces every time a FOR...NEXT loop or a REPEAT...UNTIL loop is detected.
If you are using the screen editor then make sure that you list the program with LISTO 0 or else you will copy all those extra spaces into the line! A few points to watch when using FOR...NEXT loops: 1. The loop always executes at least once. 10 FOR X=20 TO 0 20 PRINT X 30 NEXT >RUN 20 The loop finishes with the ‘control variable’ larger than the terminating value. In the next two examples the terminating value is 10. 10 FOR Z=0 TO 10 STEP 3 20 PRINT Z 30 NEXT 40 PRINT "OUT OF LOOP" 50 PRINT Z > >RUN 0 3 6 9 OUT OF LOOP 12 10 FOR Z=0 TO 10 STEP 5 20 PRINT Z