General information
Title:
Rawprint, comparing codes
Please compare both codes
Do you guys think is the any relevant differences between codes below
**************This is the code I am using********************
** Works fine, but some users complain it does not print****
Set Classlib To rawprint
vprdev=CreateObject("PrintDev")
If Empty(vprdev.cprintername)
vprdev.cprintername = GetPrinter()
Endif
vprdev.cfilename = 'myfile.txt'
If vprdev.oOpen()
if !vprdev.oPrintFile()
wait window 'Error'
endif
vprdev.oClose()
Endif
Release vprdev
Set Classlib to
**************This is the new code I found over the internet******************
*PrintRaw
LPARAMETER zcOutput
LOCAL lcPrinter
lcPrinter = UPPER(SET("PRINTER", 2))
LOCAL lcSavePrinter
lcSavePrinter = SET("PRINTER", 3)
SET PRINTER TO NAME (lcPrinter)
LOCAL oPrnDev
SET CLASSLIB TO RawPrint ADDITIVE
oPrnDev = CREATEOBJECT("PrintDev")
oPrnDev.cPrinterName = lcPrinter
oPrnDev.cDocName = "Receipt"
IF oPrnDev.oOPen()
** Send the data and codes and reset the line spacing to 1/6th inch...
oPrnDev.oPrintMem(zcOutput + CHR(27) + "2")
oPrnDev.oClose()
ELSE
* Error opening device; fall thru for now
ENDIF
RELEASE oPrnDev
RELEASE CLASSLIB RawPrint
SET PRINTER TO NAME (lcSavePrinter)
RETURN
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only