Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing a text file from within VFP
Message
From
23/03/1999 09:12:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Printing a text file from within VFP
Miscellaneous
Thread ID:
00200878
Message ID:
00200878
Views:
57
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
Map
View

Click here to load this message in the networking platform