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 #67 background imageLoading...
Page #67 background image
Sometimes the delay loop is sandwiched on the same program line:
NEW
10 FOR DELAY=1 TO 300:NEXT DELAY
LIST
RUN
Sample Programs
The programs below use FOR-NEXT loops in a variety of ways. The
first program uses the FOR-NEXT loop as a simple delay loop to leave
the word HI on the screen long enough to be read before line 30
clears the screen:
NEW
1 REM *** DLAYLOOP ***
5 PRINT " "
10 PRINT "HI"
20 FOR DELAY=1 TO 800:NEXT DELAY
30 PRINT " "
40 PRINT "BYE"
50 FOR DELAY=1 TO 800 : NEXT DELAY
The next program uses a numeric variable in the FOR-NEXT loop. It
also uses a TRAP command that refers the computer back to the
previous line, giving no specific message about the error:
NEW
1 REM *** HOWHIGH? ***
10 DIM A$ (1), HH$(1)
20 PRINT " "
30 PRINT:PRINT "HOW HIGH DO YOU WANT TO COUNT";
40 TRAP 30
50 INPUT HH
55 HH$=STR$(HH) : IF HH$="0" THEN GOTO 30
60 FOR COUNT = 1 TO HH
70 PRINT COUNT
80 NEXT COUNT
90 PRINT :PRINT "PLEASE ANSWER (Y/N) . WOULD YOU LIKE TO
COUNT AGAIN";
100 TRAP 90
110 INPUT A$
120 IF A$="Y" THEN GOTO 30
130 IF A$="N" THEN PRINT:PRINT "BYE":END
140 GOTO 90
The last program paraphrases an old rock 'n' roll song and uses
"nested" FOR-NEXT loops. A nested FOR-NEXT loop is a smaller
delay loop inside a larger FOR-NEXT loop. The program also uses OR
to create multiple conditions in the IF-THEN statement:
62

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