Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rawprint, comparing codes
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Rawprint, comparing codes
Divers
Thread ID:
01324353
Message ID:
01324353
Vues:
77
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform