AllExperts > Qbasic, Quickbasic 
Search      
Qbasic, Quickbasic
Volunteer
Answers to thousands of questions
 Home · More Qbasic, Quickbasic Questions · Answer Library  · Encyclopedia ·
More Qbasic, Quickbasic Answers
Question Library

Ask a question about Qbasic, Quickbasic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Don Schullian
Expertise
I`ve worked in BASIC since the Commodore days and maintain a web site part of which is devoted to helping others with thier problems. I`m proficient in all versions of PowerBASIC but cross over to QuickBASIC and Qbasic frequently.

 
   

You are here:  Experts > Computing/Technology > Basic > Qbasic, Quickbasic > LPRINT statements

Qbasic, Quickbasic - LPRINT statements


Expert: Don Schullian - 2/26/2009

Question
I have been using QBASIC for many years, but with my newer computers (from 1992 on)the LPRINT statements do not work.  I have gotten around the problem by using WRITE #1, but this does not allow the formatting of the output.  For example I cannot create a for-next loop to print a series of numbers in a single line.  

As an example:
F$ = "###,###,###,###,###,###"
 FOR i = 1 to 5
   x(i) = i^2
 NEXT i

 FOR J = 1 to 5
   LPRINT USING F$; x(j);
 NEXT J

 END  

Answer
Hi,

 Unfortunately this is just the way things are going. I'm now using VISTA which likes DOS less than XP did, and if/when W7 comes out I don't hold out much hope. As far as you're problem goes the only trusty solution I can think of that is going to work across all the different printers (remember they, too, aren't 100% compatible with each other) is to create the whole line of print using a string variable then print that variable.

 I don't know if this will help you or not but it's free so nothing is lost. Go to this URL and download DOSPrint.

http://www.powerbasic.com/support/downloads/files/DOSPrint.zip

 Hope this helps.  

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.