Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rawprint, comparing codes
Message
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01324353
Message ID:
01324358
Views:
12
This is the difference
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 
The particular code you're sending may not work for every printer.

Did you try running this code?


>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
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform