EasyManua.ls Logo

Commodore VIC-20 - BASIC Commands

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...
There
must
be
NO
SPACE
between
the
quotes
in
this
line,
to
indicate
an
empty
value.
When
the
person
is
not typing
anything,
the
empty
value
goes
into
the
string
variable
(in
this
case
represented
by
AS
and
the
IF
statement
sends
the
program
back
to
the
GET
statement. This loop
repeats
indefinitely,
until
the
person
operating the
computer
hits
any
key
on
the
keyboard.
At
this
point,
the
program
continues
with the
line
following
line
10.
Add
this
line
to
the
program:
100
PRINT
AS;
:
GOTO
10
Now
RU
N
the
program.
No
cursor
appears
on
the
screen,
but
any
character
you
type
will
be
printed
on
the
screen.
This
includes
all
special
functions,
like
cursor
and
color
controls
and
clearing
the
screen.
This
two-line
program
can
be
developed
into
a
screen
editor,
shown
below.
There
are
many
features
that
you
could
use
in
a screen
editor.
A
flashing
cursor
is
nice
to
have,
and
can
be
programmed.
Also,
you
may
wish
to
"trap
certain
keys,
ke
|jfflj
,
so as
not
to
i
erase
the
screen
accidentally.
Or
you
may
wish
to
program
the
function
keys
for
whole
words.
The
following
lines
give
each
function
key
a
special
purpose.
Remember,
this
is
only the
beginning
of
a
program
that
you
can
customize
for
your
needs,
like
word
processing
or
data
capture.
,
20
IF
AS -
CHRS(133)
THEN POKE
36879.8:
GOTO
10
30
IF
AS
-
CHR$(134)
THEN POKE
36879,27:
GOTO
10
40
IF
A$
-
CHR$(135)
THEN
AS="DEAR
SIR:"
+
,
CHRS(13)
50
IF
AS
=
CHR$(136)
THEN
AS =
"SINCERELY,"
+
CHRS(13)
The
CHRS
numbers
In
the
parentheses
come
from
the
CHRS
code
chart
in
the
Appendix,
which
lists
a
different
number
for
each
key
character.
The
four
function
keys
are
activated
here
to
perform
the
tasks
represented
by
the
instructions
which
immediately
follow
the
word
THEN
in
each
line
...
of
course
you
could
designate
different
keys
by
changing
the
CHRS
number
in
parentheses,
and
different
instructions
after
the
THEN
statement.
78
I
[