Characters In Commands - OKIDATA 120 Handbook

For commodore computers
Table of Contents

Advertisement

The
CHR$(14) code
is a non-printing control
code
that
tells
your printer to print in double-width size.
The
printer reads
the number 14 as a Commodore ASCII decimal code num-
ber, a standard code system used by Commodore com-
puters. Notice the CHR$ code and the quotation mark
are
separated by a semicolon.
Sometimes, for more complex features, the OKIDATA 120
uses combinations of CHR$ codes. The first code in this
combination is usually CHR$(27), called the "ESCAPE"
code. This code tells the printer to interpret the codes that
follow as part of an instruction. For example:
10
OPEN 1,<';
20
PRINT#1,"THIS CODE ";CHR$(27);CHR$(67);
"STARTS UNDERLINING,"
30
PRINT#1,"AND THIS CODE ";CHR$(27);CHR$(61l);
"STOPS
IT."
<';0
CLOSE1
TH
I S CODE
S1B.~T~l)J~J!_~_8.J::!.I.NI~.g
..
L
8-'~JL
TH.I.!2.
__
!;' ; ;P...R' s .
STOPS IT.
-
Characters in commands
________________
..lJ
22
Commodore ASCII decimal code numbers 32 through 126
represent printable characters, including letters, numbers
and symbols. The chart
in
Appendix C shows these charac-
ters and codes. Using a PRINT# with one of these codes
causes it to print the corresponding character. For example,
CHR$(65) equals the letter "A":
10
OPEN 1,<';
20
PRINT#l CHR$(65)
causes the letter "A" to be printed.
This works in reverse, too. When an ASCII decimal code
used in a command also represents a printable character,
you can substitute the decimal number with the actual
character, surrounded by quotes. To clarify this, we'll use

Advertisement

Table of Contents
loading

Table of Contents