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 #343 background imageLoading...
Page #343 background image
Chapter
10
I
BASIC
Ke.ywords
WHILE
...
WEND
Statement
WHILE
expression
WEND
Executes a series of statements in a loop as long as a given con-
dition is true.
Expression
is any numeric
or
string expression, usually making
logical
or
relational comparisons.
If
expression
is true, BASIC executes the statements after the
WHILE statement until it encounters
a
WEND statement. Then
BASIC returns
to
the WHILE statement and checks
expression.
If it is still true, BASIC repeats the process. If it is not true, exe-
cution resumes with the statement following the WEND
statement.
You may nest WHILE/WEND loops to any level. Each WEND
matches the most recent WHILE. An unmatched WHILE state-
ment causes
a
“WHILE without WEND” error, and an un-
matched WEND causes
a
“WEND without WHILE” error.
Sample Program
90 “BUBBLE SORT ARRAY
A$
100 FLIPS=l “FORCE ONE PASS THRU LOOP
11
0 WHILE FLIPS
115 FLIPS=0
120 FOR
I=l
TO
J-1
130 IF A$(I)>A$(I+l)THEN SWAP
A$<I),
140 NEXT
I
150 WEND
A$(I+1
1:
FLIPS=l
This program sorts the elements in
array
A$. Control
falls
out
of
the WHILE loop when no more swaps are performed on Line
130.
341

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