General information
Category:
Coding, syntax & commands
Title:
Printing a text file from within VFP
What is the best way to print a plain-text file (as opposed to RTF) from within a VFP program or form? Here is an example of what I've tried so far.
** Use low-level file functions to open the text file
** and read it into a memvar
gnfilehand = fopen("c:\jomast.str")
nsize = fseek(gnfilehand,0,2)
= fseek(gnfilehand,0,0)
cstring = fread(gnfilehand, nsize)
** Output the contents of the memvar to the default printer
set printer on
set printer font 'Courier', 12
set printer to default
? cstring
eject
set printer to
set printer off
eject
It spools the output (albeit very slowly, 1 byte / sec), but refuses o actually print it. I'm running VFP 6.0 on an NT 4.0 network, and sending the output to a HP LaserJet 5.
Bill Yater
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