Qbasicnews.com
January 22, 2018, 04:51:27 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]
  Print  
Author Topic: USB Printer problems  (Read 3169 times)
GordonSweet
Guru
**
Posts: 287



WWW
« on: October 24, 2012, 05:05:09 AM »

I cannot get an Epson Stylus S22 USB printer to printout using the usual LPRINT with QB. I expect other USB printers do not work now with QB

Any suggestions please. The printer works OK with other Basics etc.
Logged
burger2227
New Member

Posts: 3


« Reply #1 on: February 20, 2013, 01:46:43 PM »

You can assign the LPRINT text output to the default USB printer.


Code:
CLS
COLOR 11: LOCATE 2, 20: PRINT "XP or NT USB Printer to assign for LPRINT"
COLOR 10: LOCATE 3, 4: PRINT "In Control Panel, set the USB printer to Share with Text Format (not RAW)."

Computer$ = ENVIRON$("COMPUTERNAME")

IF LEN(Computer$) = 0 THEN
          SHELL "NET VIEW"
          COLOR 14: INPUT "               Enter your NT Computer Name: ", Computer$
END IF

IF LEN(Computer$) THEN
    SHELL "NET VIEW " + Computer$: COLOR 10: PRINT "    Computer Name = "; Computer$
ELSE : COLOR 12: PRINT "          Program cannot Continue!": SLEEP 4: SYSTEM
END IF

COLOR 14: INPUT "        Enter the USB Printer's Share Name from above: ", Printer$

PRINT
IF LEN(Printer$) THEN
    SHELL "NET USE LPT1 \\" + Computer$ + "\" + Printer$
ELSE : COLOR 12: PRINT "         No Entry, Program Aborted! ": SLEEP 4: SYSTEM
END IF

PRINT
COLOR 10: PRINT "              Testing your Printer!"
LPRINT "Test of USB Printer use with LPRINT in NT!" + CHR$(10) 'linefeed
LPRINT CHR$(12) 'formfeed

COLOR 14: PRINT "           Did the Printer work correctly? (Y/N) ";
DO: work$ = UCASE$(INKEY$): LOOP UNTIL work$ = "Y" OR work$ = "N"
COLOR 11: PRINT work$

PRINT
IF work$ = "Y" THEN
    OPEN "NOLPRINT.BAT" FOR OUTPUT AS #4
       PRINT #4, "ECHO Removing LPT to USB printer Network!"
       PRINT #4, "NET USE LPT1 \\" + Computer$ + "\" + Printer$ + " /delete"
       PRINT #4, "PAUSE"
    CLOSE #4
    COLOR 10: PRINT : PRINT "NOLPRINT.BAT created! Use BAT file to cancel sharing."
ELSE :
    SHELL "NET USE LPT1 \\" + Computer$ + "\" + Printer$ + " /delete"
    COLOR 12: PRINT " Sorry! Did not setup printer! Check your printer settings. "
END IF

SYSTEM

See Chapter 11, Part 7 of my Qbasic tutorial to set up the Print Processor: http://bit.ly/MXFkTM

You need to enable printer sharing on your network(a single PC has its own network) and run the program above. Set the Print Processor up for TEXT, not LEMF or RAW.
« Last Edit: February 20, 2013, 01:52:35 PM by burger2227 » Logged
Pages: [1]
  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!