EasyManua.ls Logo

Commodore Plus 4 - Page 47

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC
Version
3.5
Commands,
Functions,
and
System
Variables
Parameters
35
Required
Optional
DO
Commands
to
be
executed
by
the
loop
LOOP
UNTIL
conditional
formula
WHILE
conditional
formula
EXIT
UNTIL
conditional
formula
WHILE
conditional
formula
Example:
Example:
1.
The
UNTIL
clause
usually
contains
at
least
one
variable
that
is
compared
with
a
value.
The
condition
of
this
comparison
is
checked
each
time
the
DO
loop
executes.
The
loop
continues
repeating
until
the
condition(s)
is
(are)
met.
Pro
gram
control
then
passes
to
the
command
after
the
LOOP
command.
You
can
set
multiple
conditions
by
linking
them
with
AND
or
OR
(e.g.,
UNTIL
X
=
5
OR
Y
>
10).
SO
DO
UNTIL
X
=
10
30
PRINT
X
40
X
=
X
+
2
50
LOOP
This
DO
loop
executes
until
X
equals
10.
When
this
condition
is
met,
the
loop
ends.
2.
The
WHILE
clause
usually
contains
at
least
one
variable
that
is
compared
with
a
value.
The
condition
of
this
comparison
is
checked
each
time
the
DO
loop
executes.
The
loop
continues
repeating
while
the
condition(s)
is
(are)
met.
Pro
gram
control
then
passes
to
the
command
after
the
LOOP
command.
You
can
set
multiple
conditions
by
linking
them
with
AND
or
OR
(e.g.,
WHILE X
=
5
OR
Y
>
10).
20
DO
WHILE
X<
10
30
PRHSTT
X
40
X
=
X
+
2
50
LOOP
This
DO
loop
executes
until
X
is
greater
than
or
equal
to
10.
When
this
condition
occurs,
the
loop
ends.
Notes:
The
difference
between
UNTIL
and
WHILE
is
that
UNTIL
conditions
start
off
not
being
met;
the
loop
continues
until
they
are.
WHILE
conditions
start
off
being
met;
the
loop
continues
until
they
are
not
met.
The
conditions
in
UNTIL
and
WHILE
commands
are
always
either
true
(met)
or
false
(not
met).
If
you
use
more
than
one
condition,
join
them
with
AND
or
OR.
If
you
use
AND,
both
conditions
must
be
met;
if
you
use
OR,
only
one
condition
has
to
be
met.
Both
DO
and
LOOP
can
have
UNTIL
conditions or
WHILE
conditions,
but
not
both.

Other manuals for Commodore Plus 4

Related product manuals