EasyManuals Logo

Sharp MZ-800 User Manual

Sharp MZ-800
221 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 #72 background imageLoading...
Page #72 background image
Example
10
FOR
X=1T09
20
FOR
Y=1TO9
30
PRINT
X#*Y;
Inner
loop
40
NEXT
Y
50
PRINT
60
NEXT
X
70
END
Outer
loop
10
FOR
A=1
TO
3——,
20
FOR
B=1
TO
5——+
30
FOR
C=1
TO
7
110
NEXT
C
120
NEXT
B————_~
110
NEXT
C,B,A
130
NEXT
A
When
loops
C,
B,
and
A
all
end
at
the
same
point
as
in
the
example
above,
one
NEXT
statement
may
be
used
to
indicate
the
end
of
all
the
loops.
Incorrect
example:
FOR
J=1
TO
10
Fron
J=KTOK+5
NEXT
J
Different
control
variables
must
be
used
in
each
loop.
FOR
1=1
TO
10
FOR
J=K
TO
K+5
NEXT
|
NEXT
J
Loops
may
not
overlap
each
other.
Note:
The
syntax
of
BASIC
does
not
limit
the
number
of
levels
to
which
loops
may
be
nested;
however,
space
in
the
memory
is
required
to
store
return
addresses
for
each
level,
so
the
number
of
levels
is
limited
by
the
amount
of
free
memory
space
available.
The
CLR
and
LIMIT
statements
cannot
be
used
within
a
FOR
~
NEXT
loop.
6-15

Other manuals for Sharp MZ-800

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sharp MZ-800 and is the answer not in the manual?

Sharp MZ-800 Specifications

General IconGeneral
BrandSharp
ModelMZ-800
CategoryDesktop
LanguageEnglish

Related product manuals