EasyManua.ls Logo

Sharp MZ-800 - Page 54

Sharp MZ-800
221 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...
CHRS(n)
n:
numeric
value
(greater
than
32)
Returns
the
character
whose
ASCII
code
is
integer
expression
n.
When
a
space
is
to
be
displayed,
use
PRINT
“‘..””
or
PRINT
SPC(1).
Examples:
A$
=
CHR$(65)
Returns
‘‘A’’,
which
has
an
ASCII
code
of
65.
PRINT
CHR$(107)
Displays
the
graphics
character
‘‘fQ’’,
which
has
an
ASCII
code
of
107.
Multiple
ASCII
codes
can
be
specified
as
follows:
A$
=
CHR$(65,66,67,68)
LEN(x$)
x$:
character
string
Returns
the
number
of
characters
in
string
x$.
Example:
A=LEN(‘‘ABC’’)
Returns
the
number
3,
which
is
the
number
of
characters
in
string
‘‘ABC’’.
(4)
Random
number
functions
RND(n)
n:
numeric
value
This
function
returns
a
pseudo
random
number
for
a
given
numeric
value.
*
Pseudo
random
numbers
are
generated
from
values
between
0.00000001
and
0.99999999.
*
When
the
numeric
value
specified
is
greater
than
0,
the
function
gives
the
next
pseudo-random
number
in
the
current
sequence.
*
When
the
numeric
value
is
less
than
or
equal
to
0,
RND
generates
a
new
pseudo-random
number
set
whose
initial
value
is
determined
by
the
value
specified
for
X,
and
gives
the
first
number
of
the
new
set.
This
makes
an
operation
such
as
a
simulation
with
random
numbers
repetitive.
Example:
To
generate
a
random
number
which
is
an
integer
from
N
to
M,
use
the
following
formula:
INT(RND(X)
*
(M—N
+1)
+N)
The
following
program
draws
a
number
of
circles.
The
radius
of
the
circles
and
the
coodinates
are
given
by
the
random
number.
10
FOR
A=1
TO
100
20
B=RND(1)*
320
30
C
=RND(1)*
200
40
D=RND(1)*
100
50
E=INT(RND(1)*
4)
60
CIRCLE
[E,0]B,C,D
70
NEXT
A
80
END

Other manuals for Sharp MZ-800

Related product manuals