# Qbasic lines

**URL:** <https://boards.straightdope.com/t/qbasic-lines/4956>\
**Category:** Factual Questions\
**Created:** [November 26, 1999, 11:09am UTC](https://boards.straightdope.com/t/qbasic-lines/4956 "1999-11-26T11:09:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DougC](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DougC](https://boards.straightdope.com/u/DougC)\
**Post date:** [November 26, 1999, 11:09am UTC](https://boards.straightdope.com/t/qbasic-lines/4956/1 "1999-11-26T11:09:00Z")

</div>

- 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

---

<div class="post-metadata">

**Author:** ![Lord\_Jim](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@Lord\_Jim](https://boards.straightdope.com/u/Lord_Jim)\
**Post date:** [November 26, 1999, 2:54pm UTC](https://boards.straightdope.com/t/qbasic-lines/4956/2 "1999-11-26T14:54:00Z")

</div>

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

Syntax  
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).

---

<div class="post-metadata">

**Author:** ![DougC](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DougC](https://boards.straightdope.com/u/DougC)\
**Post date:** [November 27, 1999, 1:10pm UTC](https://boards.straightdope.com/t/qbasic-lines/4956/3 "1999-11-27T13:10:00Z")

</div>

- 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

---

<div class="post-metadata">

**Author:** ![Lord\_Jim](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@Lord\_Jim](https://boards.straightdope.com/u/Lord_Jim)\
**Post date:** [November 27, 1999, 4:32pm UTC](https://boards.straightdope.com/t/qbasic-lines/4956/4 "1999-11-27T16:32:00Z")

</div>

Welcome, MC, good luck.
