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?