Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing with ??? in VFP?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00510398
Message ID:
00510440
Views:
18
Rodd,
There's a great utility from Ramon F. Jaquez here on the UT called RawPrint. It allows you to send raw data including printer controls to a printer que. The following code is from a utility program I use to print files containing PCL code to a printer:
LOCAL loRawPrint
loRawPrint = NEWOBJECT("PrintDev", "rawPrint.vcx")
loRawPrint.cPrinterName = SET("PRINTER", 3) && default printer
loRawPrint.cFileName = lcFileName
IF loRawPrint.oOpen()
	IF NOT loRawPrint.oPrintFile()
		MessageBox("oPrintFile() Error sending to printer", 48, "Print Program")
	ENDIF
	loRawPrint.oClose()
ELSE
	MessageBox("oOpen() Error: " + STR(loRawPrint.nOpenError), 48, "Print Program")
ENDIF

RELEASE loRawPrint
You can also print text from a memvar using the oPrintMem() method.
HTH

>Hello,
>
>We have a legacy DOS system. For various reasons, we're trying to recomplie our DOS code in VFP. (I know, it's ugly and not recommended but I don't have time to explain our reasoning.) Anyhow, everything seems to work fine except the use of ??? to send control codes to the printer.
>
>For some reason, the first use of ??? causes a page eject. After that initial ???, all the other uses of ??? work fine.
>
>You can see this from the command window with the following:
>
>set printer to name getprinter() && select your printer
>set printer on
>
>? "This is line 1"
>??? (control code)
>? "This is line 2"
>??? (control code)
>? "This is line 3"
>
>set printer off
>set printer to
>
>In that example, the first line would print, the page would eject and then the next two lines would print ... each line being affected by the preceding printer control code.
>
>Has anyone out there found a way to get ??? to work in VFP or have a clue as to what might be happening?
>
>Thanks for whatever help you can offer!
>
>Rodd
>
>P.S. Just to set your mind at ease, we don't plan to run this DOS/VFP hybrid forever ... it's just a stop gap for an already swamped programming team. 8?)
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform