bas7advr.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 Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
LINE draws a line or box on the screen.
 
LINE [[STEP](x1,y1)] - [STEP](x2,y2) [,[color] [,[B[F]] [,style]]]
    ■ The argument color is the number of the color in which the line
      is drawn. See the COLOR Statement Details
      and SCREEN Statement Details for information
      about how to specify a color number in different screen modes.
    ■ The argument B draws a box with the points (x1,y1) and (x2,y2) as its
      diagonally opposite corners.
    ■ The argument BF draws a filled box in the selected color.
    ■ The argument style is a 16-bit integer mask used to put pixels on
      the screen.
 
Usage Notes
    ■ When coordinates specify a point that is not within the current
      viewport, the line segment to that point is drawn to the border
      of the viewpoint.
    ■ LINE reads the bits in style from left to right. If a bit is 0,
      then no point is plotted; if the bit is 1, a point is plotted.
      After plotting a point, LINE selects the next bit position in style.
    ■ Using the style argument is called "line styling."
    ■ Because a zero bit in style does not change the point on the screen,
      you may want to draw a background line before using styling so you
      can have a known background.
    ■ Style is used for normal lines and boxes, but has no effect on
      filled boxes.
    ■ STEP makes the specified coordinates relative to the most-recent
      point. For example, if the most-recent point referred to by the
      program were (10,10), the following would draw a line from (10,10)
      to the point with an x coordinate equal to 10 + 10 and a y coordinate
      equal to 10 + 5, or (20,15):
 
          LINE -STEP (10,5)
 
    ■ You can establish a new most-recent point by initializing the screen
      with the CLS and SCREEN statements. Using other graphics statements,
      (for example, PSET, PRESET, CIRCLE, or DRAW) will also establish a
      new most-recent point.
    ■ Variations of the STEP argument are shown below. For the following
      examples, assume that the last point plotted was (10,10):
 
        Statement                           Description
        ═════════════════════════════       ═════════════════════════════
        LINE -(50,50)                       Draws from (10,10) to (50,50)
        LINE -STEP(50,50)                   Draws from (10,10) to (60,60)
        LINE (25,25)-STEP(50,50)            Draws from (25,25) to (75,75)
        LINE STEP(25,25)-STEP(50,50)        Draws from (35,35) to (85,85)
        LINE STEP(25,25)-(50,50)            Draws from (35,35) to (50,50)