EasyManua.ls Logo

Apple IIe - Page 77

Apple IIe
320 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...
Applesoft
BASIC
Programming
77
ASCII
"------
The
lie
cannot
store characters;
it
can
only
store numbers.
Before
characters can
be
stored,
they
must
be
converted
to
numbers.
Computers
use
special
numeric
codes
to
store
char-
acters.
Most
microcomputers
use a
code
known
as
ASCII
(American
Standard
Code
for
Information
Interchange).
The codes used
by
the
lie
are
listed
in
AppendixG.
These codes
can
be
activated
by
including
them
with
the
CHR$
function
with
a
PRINT
statement. For
example,
the
following:
PRINT
CHR$(56)
would
cause
the
number
8
to
be
output
on
the
display.
CHR$
&
ASC
Functions
As
mentioned
earlier,
characters are represented
with
ASCII
codes.
Applesoft
BASIC's
CHR$
function
can
be
used
to
translate
an
ASCII
code
to
its
equivalent
character. The
following
short
program
illustrates
the
use
of
the
CHR$
function
.
100
PRINT CHR$(54)
200
PRINT CHR$(55)
300
END
RUN
6
7
The CHR$
function
is
often
used
to
represent characters
in
a
statement,
when
that
character can
not
be
represented
in
its
text
form
. For
example,
in
the
following
program,
100 PRINT
CHR$(34);
"JOHN
JOHNSON";
CHR$(34)
200
END
RUN
"JOHN
JOHNSON"
quotation
marks are specified
in
the
PRINT
statement using
their
ASCII
code
and
the
CHR$
function
.

Other manuals for Apple IIe

Related product manuals