EasyManuals Logo
Home>Atari>Desktop>65XE

Atari 65XE User Manual

Atari 65XE
135 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #46 background imageLoading...
Page #46 background image
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 "CONGRATULATIONS!"
120 GOTO 110
RUN
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

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atari 65XE and is the answer not in the manual?

Atari 65XE Specifications

General IconGeneral
BrandAtari
Model65XE
CategoryDesktop
LanguageEnglish

Related product manuals