home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

First Prigramming Assiment (qbasic)

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1863
Discussions: 200,923, Posts: 2,379,098, Members: 246,290
Old August 30th, 2003, 08:50 PM   Digg it!   #1 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
First Prigramming Assiment (qbasic)

My first project was to make a program in qbasic that will open a file with inventory records, and display the records, the on hand amount, value amount, on order amount and decription, and calculate the totals. This is what i got: (including comments)
BTW, the code didnt exactly copy and paste right..... so some of it may look weird.

***I got it to work thanks to rob riches code.....***

I need to make the program print if the person wants it to. I tried just copying the code and changeing print to lprint, but it doesnt work??

Any ideas?


Blaze

Last edited by Blazer06 : September 5th, 2003 at 07:46 PM.
Blazer06 is offline   Reply With Quote
Old August 31st, 2003, 01:02 AM     #2 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
**REMOVED***

keep posts short.

Please don't be rude!! if you can't help or don't want to, then keep out of the thread.
KenKun/Moderator
qball is offline   Reply With Quote
Old August 31st, 2003, 05:34 AM     #3 (permalink)
Registered User
 
Join Date: Aug 2003
Location: SoCal
Posts: 28
Send a message via AIM to DRIVER J.R.
qball you are so rude!
DRIVER J.R. is offline   Reply With Quote
Old August 31st, 2003, 08:53 AM     #4 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
DBL Post


Blaze

Last edited by Blazer06 : August 31st, 2003 at 08:56 AM.
Blazer06 is offline   Reply With Quote
Old August 31st, 2003, 08:55 AM     #5 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
qball, i didnt want others to do it for me, but to give me ideas on how i coul get my program to print.

I know my home work thats why I said ANY IDEAS not can somebody please make this work?

Please dont crap my thread.

My teacher told us that we can go out and ask for help. Because were ASKING not having otehrs do it. I dont nesiccarily want a full how to answer, just an idea of what i have to do. My teacher explained, that never would i have a job or project that i couldnt ask for help with, its not like im asking from point one "where do i begin" im asking "ideas to print since lprint isnt working..."

The code is there so people can see what im talking about and how the lprint doest work, because im not really good at explaining things.


Blaze
Blazer06 is offline   Reply With Quote
Old August 31st, 2003, 10:55 PM     #6 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
Blazer06,

my bad, not trying to crap thread, trying to help.

Quote:
My teacher told us that we can go out and ask for help.

fair enough.

Quote:
The code is there so people can see what im talking about and how the lprint doest work, because im not really good at explaining things.

fair enough. But you posted 100 lines of code, and you are not explaining your problem well enough to determine WHERE in your 100 lines the problem is.

easier way is to get 10 line working, then add 10 more, then add 10 more....

then when 10 lines no workey, you've isolated problem to those 10 lines, post those, could be in business?
qball is offline   Reply With Quote
Old September 1st, 2003, 08:07 AM     #7 (permalink)
Member
 
MrFreeze's Avatar
 
Join Date: Oct 2001
Location: Belgium
Posts: 112
don't know for qbasic, but in powerbasic i used the following

open "lpt1:" for output as #1
print #1,"hello world"
close #1
__________________
Life Suxss...
MrFreeze is offline   Reply With Quote
Old September 3rd, 2003, 12:37 AM     #8 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
MrFreeze,

just to be a wisearse, but, does that work with USB printers?
qball is offline   Reply With Quote
Old September 3rd, 2003, 01:21 AM     #9 (permalink)
Anime Otaku
 
RobRich's Avatar
 
Join Date: Oct 2001
Location: Tampa, FL USA
Posts: 108,969
Blog Entries: 15
Well, this code example should work perfectly fine for all printers, USB included. Windows platform only, of course.

---------------

DATAFILE$ = "TEST.TXT"
OPEN DATAFILE$ FOR OUTPUT AS #1
PRINT #1, "Data "
CLOSE #1

SHELL "start /m wordpad /p TEST.TXT"

---------------

The SHELL command is the key to your situation. You can save the output data into a text file, then simply use WordPad with the /p convention to print the file. This should work with any printers installed to Windows.

I'll let you work out the other details, like storing the various pieces of data into the text file with the PRINT command.

BTW, it has been years since I've worked with Qbasic, so I am using the assumption that these commands will work, if my memory proves accurate.

Robert Richmond
__________________
Robert Richmond | TechIMO Community Relations Director
Infinite perceptions. One reality.
FanFiction.Net - Unleash your imagination.
RobRich is offline   Reply With Quote
Old September 3rd, 2003, 03:42 AM     #10 (permalink)
Member
 
MrFreeze's Avatar
 
Join Date: Oct 2001
Location: Belgium
Posts: 112
as for usb printers, probably not, i dont have one to test it, google gives me:

1. Set the printer up and print a test page from Windows XP - Just to be sure.
2. Share the printer - like \\rod\usbprinter
3. Then use the printer - net use lpt3: \\rod\usbprinter


MrFreeze
MrFreeze is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2856)
Obama the Muslim (13)
Why is Khalid Sheikh Mohammed even .. (9)
Is the PSU I received dead? (10)
windows vista security holes (8)
Foreign voltage (10)
Print spooler problem (13)
HIS HD5770 graphic card question (15)
Install XP pro and a Vista laptop ?.. (9)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
New Computer wont recognize XP disc (7)
Ideal cheap graph card for PC-Gamin.. (15)
EVGA 9800 gtx help with finding a g.. (8)
Recent Discussions
Fire in DVD (0)
radeon x850xt platinum & shader 3 (2)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
windows vista security holes (8)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
Install XP pro and a Vista laptop ?? (9)
EVGA 9800 gtx help with finding a goo.. (8)
Modern Warfare For the PC (32)
Problem with speed step/turbo boost? (1)
Modern Warfare 2: Who Bought It? (61)
SIS 740 and Widescreen (8)
Baffling Problem with my CPU/MoBo's. .. (0)
HIS HD5770 graphic card question (15)
Best file format to play on Windows H.. (0)


All times are GMT -4. The time now is 10:03 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28