Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
LINE Statement Programming Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
'This example uses the LINE statement to display a series of screens
'with different line graphics.
'Note: To run this example, your screen must be 320 pixels wide by 200
'pixels high and support CGA screen mode.
SCREEN 1 'Sets up the screen mode.
LINE -(X2, Y2) 'Draws a line (in the foreground color) from
'the most recent point to X2,Y2.
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
LINE(0, 0)-(319, 199) 'Draws a diagonal line across the screen.
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
LINE(0, 100)-(319, 100) 'Draws a horizontal line across the screen.
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
LINE(10, 10)-(20, 20), 2 'Draws a line in color 2.
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
FOR X = 0 to 319 'Draws an alternating pattern (line on/line off).
LINE(X, 0)-(X, 199), X AND 1
NEXT
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
LINE (0, 0)-(100, 100),, B 'Draws a box in the foreground color.
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
LINE STEP(0,0)-STEP(200,200),2,BF 'Draws a filled box in color 2
'(coordinates are given as
'offsets with the STEP option).
DO
LOOP WHILE INKEY$ = "" 'Press any key to continue.
CLS 'Clear screen.
LINE(0,0)-(160,100),3,,&HFF00 'Draws a dashed line from the upper
'lefthand corner to the center of
'the screen in color 3.