17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

LINE Statement<br />

Purpose:<br />

To draw lines and boxes on the screen.<br />

Syntax:<br />

LINE [(x1,y1)]-(x2,y2) [,[attribute][,B[F]][,style]]<br />

Comments:<br />

x1,y1 and x2,y2 specify the end points of a line.<br />

Resolution mode is determined by the SCREEN statement.<br />

attribute specifies color or intensity of the displayed pixel (see the COLOR and PALETTE<br />

statements).<br />

B (box) draws a box with the points (x1,y1) and (x2,y2) at opposite corners.<br />

BF (filled box) draws a box (as ,B) and fills in the interior with points.<br />

Note<br />

If attribute is not specified, two commas must be used before B or BF.<br />

LINE supports the additional argument style. style is a 16-bit integer mask used when putting<br />

down pixels on the screen. This is called line-styling.<br />

Each time LINE stores a point on the screen, it uses the current circulating bit in style. If that bit<br />

is 0, no store will be done. If the bit is a 1, then a normal store is done. After each point, the next<br />

bit position in style is selected.<br />

Since a 0 bit in style does not clear out the old contents, you may wish to draw a background<br />

line before a styled line, in order to force a known background.<br />

style is used for normal lines and boxes, but is illegal for filled boxes.<br />

If the BF parameter is used with the style parameter, a "Syntax" error will occur.<br />

When out-of-range values are given in the LINE statement, the coordinates that are out of range<br />

are not visible on the screen. This is called line-clipping.<br />

In the syntax shown here, the coordinate form STEP (x offset, y offset) is not shown.<br />

However, this form can be used wherever a coordinate is used.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/LINE.html (1 of 3)28/03/2004 21.29.17

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!