EasyManua.ls Logo

Commodore 128D - The VAL Function; The STR$ Function; The Square Root Function (SQR); The Absolute Value Function (ABS)

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...
The
STOP
and
CONT
(Continue)
Commands
The
VAL
The
VAL
function
returns
a
numeric
value
for
a
Function
string
argument.
Clear
the
computer's
memory
and
type
this
program:
10A$
=
"64"
20A
=
VAL(A$)
30
?
"THE
VALUE
OF";A$;"IS";A
40
END
The
STR$
The
STR$
function
returns
the
string
representa-
Functlon
tion
of
a
numeric
value.
Clear
the
computer's
memory
and
type
this
program.
10A
=
65
20A$
=
STR$(A)
30
?
A"
IS
THE
VALUE
OF";A$
The
Square
Root
Function
(SQR)
The
square
root
function
is
SQR.
For
example,
to
find
the
square
root
of
50,
type:
You
can
find
the
square
root
of
any
positive
number
in
this
way.
The
Absolute
Value
Function
(ABS)
The
absolute
value
function
(ABS)
is
very
useful
in
dealing
with
nega
tive
numbers.
You
can
use
this
function
to
get
the
positive
value
of
any
number—positive
or
negative.
Try
these
examples:
?
ABS(5)"
IS
EQUAL
TO
"ABS(-
5)
\
You
can
make
the
computer
stop
a
program,
and
resume
running
it
when
you
are
ready.
The
STOP
command
must
be
included
in
the
program.
You
can
put
a
STOP
statement
anywhere
you
want
to
in
a
program.
When
the
computer
"breaks"
from
the
program
(that
is,
stops
running
the
program),
you
can
use
DIRECT
mode
commands
to find
out
exactly
what
is
going
on
in
the
program.
For
example,
you
can
find
the
value
of
a
loop
counter
or
other
variable.
This
is
a
power
ful
device
when
you
are
"debugging"
or
fixing
your
program.
Clear
the
computer's
memory
and
type
the
program
below.
70
USING
C128
MODE—Advanced
BASIC
Programming

Table of Contents

Other manuals for Commodore 128D

Related product manuals