NEW
10 FOR X=1 TO 4
20 PRINT "POTATO"
30 NEXT X
R U N
POTATO appears on the screen four times. Change line 10 to read like
this:
10 FOR X=1 TO 7
When you run the program this time, the screen shows POTATO seven
times. The computer is looping seven times through lines 10, 20, and
30. FOR tells the computer how many times to loop, and NEXT tells
the computer to go back to the top and start again. NEXT is similar to
GOTO. X is a variable. You can use anything to represent the variable.
Try this name for the variable:
10 FOR N U M = 1 TO 7
30 NEXT N U M
When you run the program, there is no difference from the previous
program. Change the variable name again:
10 FOR JKL=1 TO 7
30 N E X T JKL
JKL is a nonsense name for the numeric variable in the FOR-NEXT
loop. Run the program to see that it, too, runs the same as before.
Now add this line:
15 PRINT JKL,
RUN
The PRINT statement in line 15 shows the value of the variable. (Put
the comma in for readability.) Each time the computer repeats the
FOR-NEXT loop, the variable takes on the value of the next number in
the series specified in line 10. The first time, the variable is 1; the
second time, 2; and so on. The last number in the FOR statement
controls the number of times the computer loops through the program.
Change that number in line 10 as shown below:
10 FOR JKL=1 TO 50
R U N
10 FOR JKL=1 TO 200
R U N
10 FOR JKL=1 TO 500
R U N
58
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: ......