Sharp MZ-700 Owner's Manual page 80

Hide thumbs Also See for MZ-700:
Table of Contents

Advertisement

2.5.3 ASC and CHR$
Format
Function
ASC (x$)
Re turns the ASCII code for the first
x$: String expression
character in string expression x
$.
CHR$ (x)
Returns the letter whose ASCII code
x: Numeric expression corresponds to the value of numeric
expression X. (No character is
returned if the value specified for x is
less then 33
;
therefore, PRINT
11
~
"
or PRINT SPC (I) should be used to
obtain spaces, rather than CHR$ (32)).
Example
X=ASC (
11
A
11
)
Substitu
tes 65 (the ASCII code for
th
e
letter A) into variable
X.
Y
=
ASC
C"
@]H
AR
P
")
Substitutes 83 (the ASCII code for
S,
the first letter in the string "SHARP")
into variable
X.
A$=CHR$ (65)
Assigns A, the letter corresponding to
ASCII code 65, to string variable A$
.
This function can be used to display
characters which cannot be entered
from the keyboard as
follows.
PRINT CHR$
(1
07)
J
This displays the graphic character
EEl
.
Let's see, 89 is the ASCII code
f
o
r
Y,
so
..
Note: ASCII code is a standard code system which is frequently used with
computers.
This code uses
8 bit numbers to represent the letters of the
alphabet, numerals,
and symbols such as the dollar
sign and question
mark.
The full code set is presented in the table on page
154.
78
--------------------------------------------------------------------------

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents