Qbasicnews.com
February 23, 2020, 08:31:41 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: print to USB  (Read 10170 times)
Ralph
Ancient Guru
****
Posts: 544


« Reply #15 on: July 25, 2005, 08:59:39 PM »

Phillip:

did you try WhiteTiger's suggestion?  She said,

Quote
SHELL "net use lpt2: \\computer\myprinter"


If you did, what resuls(s) did you get?  

If you give the members of this board proper feedback, you will get the best help efforts!
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
philip
New Member

Posts: 6


« Reply #16 on: July 25, 2005, 09:30:34 PM »

Ralph,

I could not get her suggestion to work. I got an error message when I tried it.

I wanted to be able to print inside the QBX environment. I can do it with the compiled program; I write to an ASCII file, then open in Excel, then print.  

In the business I did own, up until a couple of months ago,  we had a Novel network and we "captured" LPT1 and then re-directed to network printers. I still do that at my office in Montreal. Here in Alabama I have a lap top and a USB printer. So, I do the print formating in Montreal. If I want to hard copy anything here I do it via the ASCII route.

I'm using QBX7.

Philip
Logged

hilip Clemmons
Cullman, Alabama
Ralph
Ancient Guru
****
Posts: 544


« Reply #17 on: July 25, 2005, 10:41:12 PM »

Philip, I have this feeling that, with your information now more visible and descriptive, someone is going to suggest a better method.  At least, I believe so.  We'll see.
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
jelamb
New Member

Posts: 17


« Reply #18 on: August 12, 2005, 11:12:28 PM »

Quote from: "Ralph"
Phillip, did you get your problem solved?  It would be nice to know exactly how.


Ralph, I have a similar problem as Phillip. I just started back using Quickbasic after having used it last around 1990. I have Windows XP and QB 4.5. I have an HP 722 Deskjet hooked up to LPT1 but I can't seem to print a hardcopy of my program to it even after I set this printer to my Default Printer. What could be the problem?
Logged
Ralph
Ancient Guru
****
Posts: 544


« Reply #19 on: August 12, 2005, 11:18:17 PM »

JELamb:
I have QuickBASIC 97, Windows Xp and an HP LaserJet 4L.  I don't have any problem printing from within QB, so, if you can give me more information, say what are you doing to print out, and what results you are getting, and  maybe we can solve your printing problem.
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
jelamb
New Member

Posts: 17


« Reply #20 on: August 12, 2005, 11:26:12 PM »

Quote from: "Ralph"
JELamb:
I have QuickBASIC 97, Windows Xp and an HP LaserJet 4L.  I don't have any problem printing from within QB, so, if you can give me more information, say what are you doing to print out, and what results you are getting, and  maybe we can solve your printing problem.


My problem at the present time is simply to print a hardcopy of the program statements as I generate a program so I will have a backup in the event that I lose the program somehow. Also, I would use this copy to help debug the logic. With the program Open, I go to File, Print and nothing happens. I would expect it to print a hardcopy to my HP 722 Deskjet.
Logged
Ralph
Ancient Guru
****
Posts: 544


« Reply #21 on: August 12, 2005, 11:46:53 PM »

JELamb:
I wrote a few lines in QB, then did, as you have done, a File, Print, Current Module.  I saw my HP LaserJet receive data, as the DATA indicating light lit up, but, no further printer action.

O.K., here's what happened.  The printer's spooler receives tha data, and waits until, in my case, it has 60 lines, at which time it will print.  However, if a "form feed" is received by the printer, it will print out whatever it hs at the time.  And, QB provides us with a simple method of doing so! Cheesy

Simply write, in the immediate window (Do an F6, and you will be in that window.  Do another F6, and you will be back in the main module window, the one we write our programs in).  So, in the immediate window, write:

SHELL "CHR$(12)"

Now, whenever you wish to print what is in the printer's spooler, simply press F6, make sure your cursor is on the line above, and press the Enter key.  You should now see your printer "doing its thing"

Let us know if this works for you!
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Anonymous
Guest
« Reply #22 on: August 12, 2005, 11:48:45 PM »

another alternative would be to just open your "bas" file in a word processor such as wordpadand pring from there
Logged
jelamb
New Member

Posts: 17


« Reply #23 on: August 13, 2005, 12:04:33 AM »

Quote from: "Ralph"
JELamb:
I wrote a few lines in QB, then did, as you have done, a File, Print, Current Module.  I saw my HP LaserJet receive data, as the DATA indicating light lit up, but, no further printer action.

O.K., here's what happened.  The printer's spooler receives tha data, and waits until, in my case, it has 60 lines, at which time it will print.  However, if a "form feed" is received by the printer, it will print out whatever it hs at the time.  And, QB provides us with a simple method of doing so! Cheesy

Simply write, in the immediate window (Do an F6, and you will be in that window.  Do another F6, and you will be back in the main module window, the one we write our programs in).  So, in the immediate window, write:

SHELL "CHR$(12)"

Now, whenever you wish to print what is in the printer's spooler, simply press F6, make sure your cursor is on the line above, and press the Enter key.  You should now see your printer "doing its thing"

Let us know if this works for you!


Nothing Happened! When you say "make sure your cursor is on the line above", what do you mean by "above", "above what"? I think I did what you asked but Nothing Happened.
Logged
Ralph
Ancient Guru
****
Posts: 544


« Reply #24 on: August 13, 2005, 12:07:40 AM »

Make sure your cursor is in the immediate window, on the line
SHELL "CHR$(12)"
Of course, first, do your File, Print, Current Module, and then do the F6 (of point with your mouse to the SHELL "CHR$(12)" line, and then press the Enter key.  Any luck now?
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
jelamb
New Member

Posts: 17


« Reply #25 on: August 13, 2005, 12:15:28 AM »

Quote from: "Ralph"
Make sure your cursor is in the immediate window, on the line
SHELL "CHR$(12)"
Of course, first, do your File, Print, Current Module, and then do the F6 (of point with your mouse to the SHELL "CHR$(12)" line, and then press the Enter key.  Any luck now?


I get "bad command or file name"
Logged
Ralph
Ancient Guru
****
Posts: 544


« Reply #26 on: August 13, 2005, 12:18:55 AM »

Hmm, yes, after a few "successes", I started to get no printout! Sad   So, I reverted to my old file, FF.COM, which I wrote in assembly language and compiled into the FF.COM short program.  This DOES work!  So, if you wish, post your email address, and I will email you and attach my FF.COM file.
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
jelamb
New Member

Posts: 17


« Reply #27 on: August 13, 2005, 04:05:48 PM »

Quote from: "Moneo"
Philip,

You might look at doing a
MODE LPT2:=COMm:
from MSDOS first, and then open LPT2 in your program and print to it.
From the MSDOS commandline do: MODE /? for options.

Do you have a printer on your USB port? If not, then just output your "printer" output to a text file, and later copy the file using Windows to your USB device.

Regarding your second question, I don't know what you mean by "capture" LPT1.
*****


I have a very similar problem...i.e. I can't seem to print to LPT1 from my QBasic program or even print a copy of the program code. The printer works fine when I set it as my default printer and print from other applications. Can you help?
Logged
Moneo
Na_th_an
*****
Posts: 1971


« Reply #28 on: August 13, 2005, 10:37:37 PM »

Quote from: "Cha0s"
another alternative would be to just open your "bas" file in a word processor such as wordpadand pring from there

Jelamb,

You will find that Cha0s' solution is the simplest. This is it. Get into Notepad or Wordpad, open the .bas file, and print it. End of problem.
*****
Logged
jelamb
New Member

Posts: 17


« Reply #29 on: August 13, 2005, 11:15:59 PM »

Quote from: "Moneo"
Quote from: "Cha0s"
another alternative would be to just open your "bas" file in a word processor such as wordpadand pring from there

Jelamb,

You will find that Cha0s' solution is the simplest. This is it. Get into Notepad or Wordpad, open the .bas file, and print it. End of problem.
*****


OK, that works for printing a copy of my program. However, I don't get any output to my printer using the Lprint command.
Logged
Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!