Creating an Interactive Loop
GOTO, DIM, INPUT
Loops tell the computer to go back and repeat instructions in the
program automatically. The GOTO command saves you the trouble of
typing the same instruction lines over and over again. The DIM and
INPUT commands allow you to interact with your computer on a
question-and-answer basis. Putting these three commands together—
GOTO, DIM, INPUT—lets you have an ongoing conversation with your
computer.
GOTO: A COMPUTER'S MAP
The simplest computer loop is the GOTO loop. GOTO is always
followed by a line number that tells the computer where to go on the
next command. You need just two commands to create a loop. Type in
the program below to produce an infinite loop:
NEW
110 PRINT " C O N G R A T U L A T I O N S ! "
120 GOTO 110
R U N
To break this infinite loop, turn off the machine or use the key.
When you stop the loop with the key, one of the following
messages appears:
STOPPED AT LINE 110
or
STOPPED AT LINE 120
The computer is telling you where it was when it received the
command to stop.
Comma: A Tab Maker
The GOTO loop puts out an endless amount of work with just two lines
of instruction. To make the program fancier, list your program, position
the cursor in the space next to the last quotation mark, insert a
comma, and press . Run the program and watch the special
effects:
LIST
110 PRINT "CONGRATULATIONS!",
120 GOTO 110
RUN
41
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: ......