advr.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
  ◄Summary►  ◄Details►  ◄Example►                ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
 LINE [[STEP](x1!,y1!)] - [STEP](x2!,y2!) [,[color%] [,[B | BF] [,style%]]]
 
 Usage Notes
   ■ You must be in a graphics screen mode (for example, screen mode 1) to
     use the LINE statement; otherwise, Visual Basic may generate the error
     message, "Illegal function call." See: ◄SCREEN Statement►
 
   ■ The available color attributes for LINE depend on your graphics adapter
     and the screen mode set by the most recent SCREEN statement.
     See: ◄Adapters and Displays►
 
   ■ 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
     viewport.
 
   ■ 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 with LINE 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 styling, so that you have
     a known background.
 
   ■ The style% argument 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 - also establishes a new
     most recent point. See: ◄CLS Statement►  ◄SCREEN Statement►
 
   ■ 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)