Experiment
#7
Displaying ASCII Characters
Type the following program:
10
FOR
I =
65
TO
90
20
PRINT CHR$(
I)
;
30
NEXT
I
and execute the program. You will see the alphabet displayed:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Ok
•
Character
Returned
Argument
Value
This program defines a loop which displays the CHR$ function with values for the
argument ranging from
65
to 90. The character returned
by
the CHR$ function for
these arguments is illustrated in the table below:
Argument Character
Value Returned
65
A
78
N
66
B 79
0
67
C
80
P
68
0
81
Q
69
E 82 R
70
F
83
S
71
G 84
T
72
H
85
U
73
I
86
V
74
J
87
W
75
K
88
X
76
L 89
Y
77
M
90
Z
The number assigned to each letter
in
the table above
is
called its ASCII value. The
range
of
possible ASCII values
is
0 to 255 and includes all characters which your
computer can store in its memory.
In addition to the upper case alphabet, there are ASCII values assigned to the lower
case alphabet
as
well. These can be printed by changing line
10
in
your program
to:
10
FOR
I =
97
TO
122
~
117