Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing with ??? in VFP?
Message
From
01/03/2002 15:01:04
 
 
To
01/03/2002 14:11:30
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00510398
Message ID:
00627164
Views:
17
Calvin, Here is the code testing using rawprint.vcx to get it to work without having to edit so many .prgs that use ??? (we have hundreds of them)! This test is just a 'minute' example. It doesn't work either though because only the last two lines actually print now. Without using rawprint, it prints the entire document but on the first ??? it ejects a page. With rawprint, it appears to only save to the file the codes after the LAST ??? was issued.
*-------------------------------------------
*--Test code for testing ??? ejecting pages
SET TALK OFF
opt = ''          
RESTORE from c:\programnotes\av_mem additive	&& these are the printer codes used below
maccount="8393827363465"
ag_state="NC"
SET CONSOLE OFF
port = GETPRINTER()
_pEject="NONE"
SET PRINTER TO NAME (port)
set PRINTER TO "testfile.txt"
SET DEVICE TO PRINT
SET PRINTER ON

??? opt
??? av_lpi8
??? av_cpi12
??? av_boldon
?? "MY TEST PREMIUM FINANCING CORPORATING, INC." AT 0
??? av_boldoff
??? av_cndsprt
? "9999 Rikkiteyti Dr.   P.O. Box 999999"
??? av_cpi12
??? av_boldon
?? "ACCOUNT NO. "+RTRIM(ag_state)+' '+TRANS(maccount,"@B 99999999999999") AT 70
??? av_boldoff
??? av_cndsprt
? "MyTown, South Carolina 23265-9999  Phone 800-555-1212"
?
? 'End of Test Only one page should print, NOT 2!'

EJECT
SET CONSOLE ON
SET PRINTER OFF
SET DEVICE TO SCREEN
SET PRINTER TO
SET TALK ON

Set Classlib to RawPrint Additive
oPrnDev = CreateObject("PrintDev")
oPrnDev.cDocName = "Document from Files"
oPrnDev.cPrinterName = set('printer', 3)
If oPrnDev.oOPen()
   oPrnDev.cFilename = 'testfile.txt'
   oPrnDev.oPrintFile()
   oPrnDev.oClose()
Else
   * Error opening device; display error number
   MessageBox("OpenPrinter() Error: "+str(oPrnDev.nOpenError))
Endif
*-------------------------------------------
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform