The computer can count backward in increments also:
10 FOR JKL=500 TO 0 STEP -20
RUN
10 FOR JKL=500 TO 0 STEP -3
RUN
10 FOR JKL=0 TO -500 STEP -50
RUN
You can also instruct the computer to start and stop at any number
you desire:
10 FOR JKL = 500 TO 300 STEP -10
RUN
10 FOR JKL=25 TO 0 STEP -1
RUN
Now you know how to instruct the computer to count forward and
backward, to count consecutively and incrementally, and to start and
stop at specified numbers.
The FOR-NEXT "Sandwich" Loop
List your program. FOR is on the top line, and NEXT is on the bottom
line. Whatever you want the computer to do is sandwiched in between.
Type in the lines below:
10 FOR JKL=1 TO 5
20 PRINT " A V O C A D O "
The computer will carry out any instruction or number of instructions
between the FOR and NEXT statements the specified number of times.
Have the computer print other words:
16 PRINT "CHEESE"
17 PRINT "MAYONNAISE"
18 PRINT "MUSTARD"
19 PRINT "TOMATO"
21 PRINT "BACON BITS"
22 PRINT "LETTUCE"
23 PRINT:PRINT
RUN
The computer prints and counts too quickly for anyone to read the
screen clearly. Nonetheless, it prints the PRINT statement exactly five
times as instructed in the FOR-NEXT statement. Other instructions,
such as math computations and INPUT statements, can also be part
of the FOR-NEXT sandwich loop.
60
Summary of Contents for 65XE
Page 1: ...ATARI 65XE PERSONAL COMPUTER OWNER S MANUAL TM...
Page 3: ...ATARI 65XE PERSONAL COMPUTER TM...
Page 6: ...Part 1 GettingStarted 1...
Page 9: ...4...
Page 23: ...18...
Page 25: ...20...
Page 32: ...Part 2 Programming withATARI BASIC 27...
Page 33: ...28...
Page 59: ...54...
Page 69: ...64...
Page 82: ...Part3 Appendices 77...
Page 83: ...78...
Page 97: ...92...
Page 105: ...100...
Page 125: ...120...
Page 126: ...121 Index...
Page 127: ...122...
Page 134: ...ATARI 1987 Atari Corp All Rights Reserved Printed in Taiwan C072018 001 REV B K l 2 1987...
Page 135: ......