BASIC Language Reference Manual > Command and Function Reference >

LINE Command


Draws a line between two points on the screen using the current graphics pen color.


LINE x1 coordinate, y1 coordinate, x2 coordinate, y2 coordinate

Remarks and Examples

The LINE command will draw a straight line on the screen from the (x1, y1) coordinate to the (x2, y2) coordinate.

The line will be drawn using the current graphics pen color. The graphics pen color can be changed using the PENCOLOR command.


100 REM Draw a magenta-colored triangle
110 CLS
120 PENCOLOR 255, 0, 255
130 LINE 100, 100, 400, 300
140 LINE 400, 300, 200, 400
150 LINE 200, 400, 100, 100

See also: PENCOLOR, Overview of Graphics Programming in ReadyBASIC

Copyright 2006-2012, Kevin Matz, All Rights Reserved.