qbasic.hlp (Topic list)
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
  ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
Draws a line or rectangle on the screen.
 
LINE [[STEP](x1!,y1!)]-[STEP](x2!,y2!) [,[color%] [,[B | BF] [,style%]]]
 
    ■ STEP          Specifies that coordinates are relative to the current
                    graphics cursor position.
    ■ (x1!,y1!),    The screen coordinates of the start of the line and of
      (x2!,y2!)     the end of the line.
    ■ color%        A color attribute that sets the color of the line or
                    rectangle. The available color attributes depend on your
                    graphics adapter and the screen mode set by the most
                    recent SCREEN statement.
    ■ B             Draws a rectangle instead of a line.
    ■ BF            Draws a filled box.
    ■ style%        A 16-bit value whose bits set whether or not pixels are
                    drawn. Use to draw dashed or dotted lines.
 
Example:
    'This example requires a color graphics adapter.
    SCREEN 1
    LINE (110, 70)-(190, 120), , B
    LINE (0, 0)-(320, 200), 3, , &HFF00
 
See Also    ◄CIRCLE►    ◄INPUT, LINE INPUT►    ◄PRESET, PSET►    ◄SCREEN►
            ◄Color Attributes and Values►    ◄Screen Modes►