Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print to file - but what's its handle?
Message
De
05/09/1997 18:06:46
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Print to file - but what's its handle?
Divers
Thread ID:
00048775
Message ID:
00048775
Vues:
67
I have a half solved problem. A customer needs a logo to be printed within a FPD2.6 (yes, DOS version) app, and some of the obvious solutions were dropped off real soon. First, printing twice over the same paper is out - the HP VI jams regular paper sometimes, and jams recycled paper even more often. Second, switching to VFP would take too much time, and they want it within a week or so. The printing is done two ways - one is from .frx and other is by ?, ?? commands (converted from a .frx, really, and then managed manually). It is always printed into a file, so it can be previewed before printing (FPD either didn't have a print preview, or it couldn't manage jumping back and forth over the printed text). No, it doesn't show up all of the HP printer codes, I've written a filter, so there's a preview version of the text, with escape sequences cleaned out. Now the approach I've taken was to try to set _text variable to the handle of the print file, but to no avail. Couldn't find any function to reveal the handle. Tried standard handles (10 to 20) but it reported them all invalid. I've found a workaround. I open the output file low-level, FSeek(fh, 0, 2) and then write to it. OK, I know it's open twice, but in some circumstances I managed to have both print and fwrite()n data run after each other (there's been lots of overlapping while I tried, and lots of garbage in the resulting file). The trouble is that I do it from a function which is called from the report, and it does get called twice for each appearance - so the inserted file (logo.prn) gets inserted where it should be, at page top, and once more at the end of file for each page (!). I've settled for printing it only once, and having the function fire only once by using an external variable (_calcvalue :), so it kind of works now (I have to solve the extra form feed before and after logo yet). Still, the question of system file handles bothers me. If we Set Alte To some_file.txt, what's its handle? Is there any way to find it out? p.s. I'll probably be in Hungary couple of days next week. When I get there, should I write the Hungarian text in reverse, or should I not reveal the beauty of RHN to the Hungarians?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Répondre
Fil
Voir

Click here to load this message in the networking platform