EasyManua.ls Logo

Commodore 128D - Introduction; Until

Commodore 128D
427 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...
Introduction
I
\
i
i
Advanced
Looping
This section
introduces
you
to
some
powerful
BASIC
commands
and
statements
that
you
probably
haven't
seen
before,
even
if
you
are
an
experienced
BASIC
programmer.
If
you're
familiar
with
programming
in
BASIC,
you've
probably
encountered
many
situations
in
which
you
could
have
used
these
commands
and
statements.
This
section
explains
the
concepts
behind
each
command
and
gives
examples
of
how
to
use
each
command
in
a
program.
(A
complete
list
and
an
explanation
of
these
commands
and
statements
may
be
found
in
Chapter
V,
BASIC
7.0
Encyclopedia.)
This
section
also
describes
how
to
use
the
special
keys
that
are
available
to
you
in
C128
mode.
The
DOf
LOOP
Statement
The
DO/LOOP
statement
provides
more
sophisticated
ways
to
cre
ate
a
loop
than
do
the
GOTO,
GOSUB
or
FOR/NEXT
statements.
The
DO/LOOP
statement
combination
brings
to
the
BASIC
language
a
very
powerful
and
versatile
technique
normally
available
only
in
structured
programming
languages.
We'll
discuss
just
a
few
possible
uses
of
DO/LOOP
in
this
explanation.
If
you
want
to
create
an
infinite
loop,
you
start
with
a
DO
statement,
then
enter
the
line
or
lines
that
specify
the
action
you
want
the
com
puter
to
perform.
Then
end
with
a
LOOP
statement,
like
this:
100
DO
110
PRINT
"REPETITION"
120
LOOP
Press
the
RUN/STOP
key
to
stop
the
program.
The
directions
following
the
DO
statement
are
carried
out
until
the
program
reaches
the
LOOP
statement
(line
120);
control
is
then
transferred
back
to
the
DO
statement
(line
1OO)<
Thus,
whatever
statements
are
in
between
DO
and
LOOP
are
performed
indefinitely.
UNTIL
Another
useful
technique
is
to
combine
the
DO/
LOOP
with
the
UNTIL
statement.
The
UNTIL
statement
sets
up
a
condition
that
directs
the
loop.
The
loop
will
run
continually
unless
the
condition
for
UNTIL
happens.
100
DO:
110
:
INPUT
"DO
YOU
LIKE
YOUR
COMPUTER";A$
120
LOOP
UNTIL
A$
=
"YES"
130
PRINT
"THANK
YOU"
USING
C128
MODE—Some
BASIC
Commands
and
Keyboard
Operations
Unique
to
75
C128
Mode

Table of Contents

Other manuals for Commodore 128D

Related product manuals