EasyManua.ls Logo

Commodore VIC-20 - Page 96

Commodore VIC-20
308 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...
3
bytes
of
memory
(one
for
each
number}
while
the
number
1
uses
only
1
byte.
,
PUTTING
MULTIPLE
INSTRUCTIONS
ON
EACH
LINE
You
can
put
more
than
one
instruction
on
each
numbered
line
in
your
program
by
separating
them
by a
colon.
The
only
limitation
is
that
all
the
instructions
on
each
line,
including
colons,
should
not
exceed
the
standard
88-character
line
length.
Here
is
an
example
of
two
programs,
before
and
after
crunching:
BEFORE
CRUNCHING:
AFTER
CRUNCHING:
10
PRINT
"HELLO.
..";
10
PRINT
"HELLO.
.
.";:FOR
T =
1
TO
500:NEXT:PRINT
20
FORT
=
1TO500:NEXT
"HELLO,AGAIN.
.
.":GOTO10
30
PRINT
"HELLO,
AGAIN.
.
."
40
GOTO10
I
REMOVING
REM
STATEMENTS
REM
statements
are
helpful
in
reminding
yoursei*—or
showing
other
programmers—what
a
particular
section
of
a
program
is
doing.
However,
when
the
program
is
completed
and
ready
to
use,
you
probably
won't
need
those
REM
statements
anymore
and
you
can
save
quite
a
bit
of
space
by
removing
the
REM
statements.
If
you
plan
to
revise
or
study
the
program
structure
in
the
future,
it's
a
good
idea
to
keep
a
copy on
file
with
the
REM
statements
intact.
USING
VARIABLES
If
a
number,
word
or
sentence
is
used
repeatedly
in
your
program
it's
usually
best
to
define
those
long
words
or
numbers
with
a
one
or
two
letter
variable.
Numbers
can
be
defined
as
single
letters.
Words
and
sentences
can
be
defined
as
string
variables
using
a
letter
and
dollar
sign.
Here's
one
example:
BEFORE
CRUNCHING
AFTER
CRUNCHING
10
POKE
36878, 15 10
POKE
36878,
15:
S =
36874
20
POKE
36874,
200
30
POKES,
200:POKES, 250:POKES,
30
POKE
36874.
250
150
40
POKE
36874,
150
B0
i

Other manuals for Commodore VIC-20

Related product manuals