EasyManua.ls Logo

Commodore Plus 4 - Page 107

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.S
Commands,
Functions,
and
System
Variables
95
TRON
Abbr.
trO
Turns
on
built-in
error-tracing
functions.
The
tracing
function
displays
the
line
number
on
each
line
in
the
program
as
the
program
executes.
This
function
helps
you
locate
a
line
that
is
causing
program
error.
UNTIL
Abbr.uN
Sets
a
closing
condition
in
a
DO
.
. .
LOOP
sequence.
When
you
include
an
UNTIL
clause
in
a
DO
loop,
the
loop
executes
until
a
condition
is
met.
See
DO.
USR
Abbr.
uS
USR
(number^
This
is
a
BASIC
function
(i.e.,
it
is
invoked
by
setting
some
variable
equal
to
it).
USR
goes
immediately
to
a
user-callable
machine
language
subroutine
whose
starting
address
is
contained
in
memory
locations
1281
and
1282.
Before
you
can
use
the
USR
function
to
access
a
machine-language
subroutine,
you
must
POKE
the
subroutine
address
to
memory
locations
1281
and
1282.
If
you do
not,
the
execution
of
a
USR
function
aborts
the
program
and
displays
an
ILLEGAL
QUANTITY
ERROR
message.
The
number
in
parentheses
is
a
variable
or
formula
you
are
sending
to
be
used
in
the
machine-language
subroutine.
It
is
stored
in
floating-point
accumulator
1.
At
the
end
of
the
subroutine,
the
value
in
floating-point
accumulator
1
is
returned
to
the
BASIC
program
as
the
value
of
USR.
Using
a
machine-language
subrou
tine
is
much
like
using
a
BASIC
user-defined
function:
you
send
a
value
to
be
used,
and
it
sends
back
to
the
main
program
the
resultant
value.
USR
is
a
window
between
BASIC
and
machine
language.
See
Chapter
5
for
more
information.
VAL
Abbr.vA
VAL
(string)
Converts
a
text-string
number
to
a
numeric
value
when
you
have
a
number
in
a
text-string
variable
instead
of
a
numeric
variable.
For
example,
you
might
input
a
phone
number
as
a
text-string
variable,
and
then
want
to
use
it
as
a
number
to
dial
your
automodem.
If
the
text=string
value
contains
characters
that
are
not
numbers
or
acceptable
parts
of
numbers
(e.g.,
minus
signs,
decimal
points,
or
E,
which
connotes
scien
tific
notation),
the
rest
of
the
string
is
not
converted.
If
the
first
character
is
not
an
acceptable
character,
VAL
returns
a
zero.
Example:
10
GETKEY
A$
One
key
is
gotten
from
the
20
IP
VAL(A$)<>0
THEN
G0SUB
80
keyboard.
If
it
is
a
digit
from
30
END
1
to
9,
the
subroutine
is
80
PRINT"THE
DIGIT
IS
";A$
executed.
90
RETURN

Other manuals for Commodore Plus 4

Related product manuals