Chawter
10
I
BASIC
Kevwords
POINT/Graphics
Function
POINT
(x,y)
POINT
(action)
Returns the color number
of
a
point on the screen
or
returns the
current physical or world coordinates.
(x,y)
specify the coordinates
of
the point.
x
is the horizontal
point, and
y
is the vertical point. The
x
and
y
coordinates must
be absolute values. If you specify
a
point that is out
of
range,
BASIC returns
a
-1.
See Chapter
8,
“Displaying Color and Graphics,”
for
information
on coordinates
for
the current screen modes.
Action
is one of the following:
0
returns the current physical x-coordinate (horizontal).
1
returns the current physical y-coordinate (vertical).
2
If WINDOW is active, returns the world x-coordinate.
3
If WINDOW is active, returns the world y-coordinate.
When retrieving the color number, POINT returns the
color
number as it
is
defined in the current palette.
Otherwise, returns the physical x-coordinate.
Otherwise, returns the physical y-coordinate.
Example
10
SCREEN
2
20
IF POINT
(1
,1)<>0 THEN PRESET (1
,I
1
ELSE PSET
(1
,I)
If point
1,l
is any foreground color, PRESET changes it
to
the
background color.
If
the point
is
the
background
color,
PSET
changes it to Color
3.
10
SCREEN 1
20
X=POINT (0):Y=POINT(I)
30 PRINT
X,Y
BASIC prints the coordinates
of
the graphics cursor.
267