Chapter
10
I
BASIC
Ke.ywords
LINE/Graphics
Statement
Draws a line
or
a box on the video display.
The STEP option tells BASIC that the
(x,y)
coordinates are rela-
tive
to
the last point referenced.
If
you use STEP with the sec-
ond set
of
coordinates, the coordinates are relative to the first
set of coordinates.
(x1,yl)
specifies the point at which
to
begin the line.
xl
is the
horizontal coordinate, and
yl
is the vertical coordinate. If you
omit
(x1,yl)
BASIC begins the line at the last point referenced
on the screen.
(x2,yZ)
specifies the point
at
which to end the line.
x2
is the hor-
izontal coordinate and
y2
is the vertical coordinate.
Color
indicates the color of the line.
See Chapter
8,
“Displaying Color and Graphics” for information
on coordinates and colors for the current screen mode.
If
you specify coordinates that are not in the range of the cur-
rent viewport, BASIC displays only that portion
of
the line that
is within the viewport.
With the
B
option, BASIC draws a box. The points that you
specify are opposite corners.
If
you specify both the
B
and
F
options, BASIC draws a box and
fills the box in with
color.
Style
lets you select the line-style used when drawing normal
lines and unfilled boxes.
Style
is a 16-bit integer. Each bit repre-
sents a point in the line.
If
the bit equals
1,
then the point
is
drawn.
If
the bit equals zero, then the point
is
not drawn.
A
zero
bit does not erase
a
previously drawn point; therefore, you may
want to draw a background line first to have a known back-
ground. The style pattern is repeated as necessary, to complete
the line drawing.
199