EasyManua.ls Logo

Commodore Plus 4 - Page 168

Commodore Plus 4
234 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...
EXAMPLE
PRINT
INSTR('THE
CAT
IN
THE
HAT",
'CAT")
the
result
is
5,
because
CAT
starts
at
the
fifth
character
in
string
1
INT(X)
(integer)
Returns
the integer
portion
of
X,
with
all
decimal
places
to
the
right
of
the
decimal
point
removed.
The
result
is
always
less-than
or
equal
to
X.
Thus,
any
negative
numbers
with
decimal
places
become
the
integer
,
less-than
their
current
value
(e.g.
INT(-4.5)=
-5).
If
the
INT
function
is
to
be
used
for
rounding
up
or
down,
the
form
is
—>
INT(X+/-
.5),
_
EXAMPLE.
X=IMT(X*100
+
.5)/100
_
Rounds
to
the
next
highest
penny.
—■
JOY
(n)
_
When
n
=
1
Position
of
joystick
#1
n
=
2
Position
of
joystick
#
2
*—■
Any
value
of
128
or
more
means
the
fire
button
is
also
depressed.
The
direction
is
indicated
as
follows
UP
_
fire
=
128+
1
8
2
LEFT
7
0 3
RIGHT
~
6
4
5
DOWN
u
EXAMPLE
JOY(2)=135
__
joystick
#2
fires
to
the
left
LOG(X)
(logarithm)
~~
This
returns
the
natural
log
of
X.
The
natural
log
is
log
to
the
base
e
(see
EXP(X)).
To
convert
to
log
base
10,
divide
by
LOG(
10).

Other manuals for Commodore Plus 4

Related product manuals