Atari 65XE Owner's Manual page 64

Hide thumbs Also See for 65XE:
Table of Contents

Advertisement

Starting Point
List the program. The first number in the FOR line is the starting point
for the count, and the last number is the stopping point. Even negative
numbers can be the starting point for the count. Try these variations
for line 10:
10 FOR JKL=1 TO 5
RUN
10 FOR JKL=0 TO 5
RUN
10 FOR JKL=3 TO 5
R U N
10 FOR JKL=-10 TO 5
RUN
STEP: Counting Incrementally
List the program, delete the PRINT statement in line 20 and the
comma in line 15, and run the program. The computer counts and
prints the numbers very quickly. Use the STEP command to make the
computer count in increments. Try the program below:
10 FOR JKL=0 TO 500 STEP 5
RUN
10 FOR JKL=0 TO 500 STEP 2
R U N
10 FOR JKL=0 TO 500 STEP 100
R U N
10 FOR JKL=0 TO 500 STEP 7
RUN
The computer will obligingly count by any sequence you specify.
Counting Backward
The computer can count backward if you use the STEP -1 command
and the proper sequence of numbers (from larger to smaller) for
starting and stopping the count. For example:
10 FOR JKL=500 TO 0 STEP -1
RUN
10 FOR JKL=10 TO 0 STEP -1
RUN
10 FOR JKL = -1 TO -19 STEP -1
RUN
59

Advertisement

Table of Contents
loading

Table of Contents