Qbasic lines

  • Anybody know what is the exact format for drawing lines and boxes in qbasic 4.5? - Mine don’t work, the help file isn’t anywhere that I can find. The couple books I have only explain mode 2 and I want mode 12. My attempts, if they work at all, only result in one pixel of the specified color in the upper left-hand corner; no line. - MC

MC, found this in Quick Basic 4.5 help section, is this what you are looking for.

LINE - a graphics statement that draws a line or box on the screen

LINE [[STEP] (x1,y1)]-[STEP] (x2,y2) [,[color][,[B[F]][,style]]]
_ (x2,y2) are the screen coordinates of the end of the line
_ (x1,y1), if used, is the start of the line
_ STEP, if used, enables you to specify relative screen coordinates
_ color, B, BF, and style are <Details>

See Also <SCREEN statement> <CIRCLE> <PSET>
Tip: SCREEN is especially important because it determines the range of
numbers you can use to specify (x2,y2).

  • Thanks Jim.
      • The only book that showed an example showed it as used a section of example code that read:
        LINE [[STEP] (r1,c2)]-[STEP] (r1,c2)[,[color][,[B[F]][,style]]]-

where rX and cY are the ends of the line. I was including the ® and © with the expressions not knowing that in the example ® and © had their own values in that program. - MC

Welcome, MC, good luck.