Chapter
10
I
BASIC Ke,ywords
SCREEN
Function
SCREEN
(row,
column,
[
num
ber])
Returns the ASCII code
for
the character at the specified row
and column.
Row
is an integer in the range
1
to
25.
Column
is an integer in the range
1
to
80. Column
must be in
the range
for
the current screen mode.
Number
is applicable only
for
text mode. If you specify a non-zero
number,
SCREEN returns the color attribute, rather than the
ASCII code,
of
the character. The attribute is in the range
of
0
to
255,
and can be translated as follows:
attribute
MOD
16
=
foreground color
(((attribute
-
foreground)/
16)MOD 128)
=
background color
(number>l27)
is true
(-1)
if the character is blinking and false
(0)
if it is not.
In the graphics modes, if the location does not contain a stan-
dard ASCII character, BASIC returns a value
of
zero.
Sample
Program
10
LOCQTE 20,20
20
PRINT
“ROBBIE”
30
A
=
SCREEN(20,20):B
=
SCREEN(20,2l)
40
PRINT
A,B
Line
10
positions the cursor to
Row
20,
Column
20.
Line
20
prints the message
at
the current cursor position. Line
30
stores
the ASCII code
for
“R’
in the variable
A
and the ASCII code
for
“0”
in variable B. Line
40
prints:
82
79
302