Chr - Sharp PC-1500A Instruction Manual

Hide thumbs Also See for PC-1500A:
Table of Contents

Advertisement

All
and
more
about Sharp
PC-1500
at
http://www.PC-1500.info
{
'
''
c ha racter"
ASC
.
cl)ar va nable
name
The argurnent in this function is any character
St(ing
or a
character
string
variable
name
.
The
value returned
by
this function
is the
corresponding ASCII code for
the
first
characte
r of
the
specified string.
Example
1:
Output:
10
LET
XS
=
..
PATTI
..
20 LET A
=
ASC XS
30
PRINT A
RUN
In
the above example
XS is
assigned the
value
of
the
character st,ring
"PATTI
". The ASC function
takes the
first
character
(P) and converts
it
to
its ASCII
code
(SO).
Example
2:
10
PRINT
ASC ..
K
..
Output:
RUN
-;-i
---------
~
ASC "K" returns the ASCII
code for
..
K ..
which is 75.
C.2.
CHR$
CH R
$
is the
complement o
f
the
ASC
func tion.
The
CH R $
function
takes an
ASCII decimal
code. from 0 through 127, and returns
the
character
string equ ivalent.
(Nole: Some
codes
represent special
characters
which do not print}
Example 1:
Output:
I
ASCII.
decimal
code
CHAS
numeric
variable
10
PRINT (CHAS 67)
+
.. OP"
RUN
COP
73
Do not
sale
this PDF
!!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents