EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 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 #167 background imageLoading...
Page #167 background image
Chapter
10
I
BASIC Keywords
Sample Program
BASIC always sets the final value for the loop variable before
setting the initial value. For example:
820 I=5
830 FOR
I
=
1
TO
I
+
5
840 PRINT
I;
850 NEXT
executes the loop
10
times, which prints:
12345678910
Nested
Loops
FORiNEXT loops may be nested; that is,
a
FOR/NEXT loop may
be placed within the context of another FOR/NEXT loop.
The NEXT statement for the inside loop must appear before the
NEXT for the outside loop.
If
nested loops have the same end
point, a single NEXT statement may be used for all of them.
Sample Program
880 FOR
I
=
1
TO
3
890 PRINT "OUTER LOOP"
900 FOR
J
=
1 TO 2
91 0 PRINT
"
INNER LOOP"
920 NEXT
J
930 NEXT
I
This program performs
3
outer loops and
2
inner loops within
each of the outer loops. BASIC prints the following:
OUTER LOOP
INNER LOOP
INNER LOOP
INNER LOOP
INNER
LOOP
INNER LOOP
INNER LOOP
OUTER LOOP
OUTER LOOP
165

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals