Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement