form command and printer file "nameoffile"

Dennis Malen dmalen at malen.com
Tue May 15 12:35:28 PDT 2012


Thanks Brian,

That's a keeper.

Dennis

-----Original Message-----
From: filepro-list-bounces+dmalen=malen.com at lists.celestial.com
[mailto:filepro-list-bounces+dmalen=malen.com at lists.celestial.com] On Behalf
Of Brian K. White
Sent: Tuesday, May 15, 2012 3:02 PM
To: filepro-list at lists.celestial.com
Subject: Re: form command and printer file "nameoffile"

On 5/15/2012 1:09 PM, Dennis Malen wrote:
> I also tried: printer file "nomjudg.txt"; form "affatty"


Do it like this:

et = "/tmp/filename.txt"
system noredraw "umask 0;>"{et
printer type "hplaser"
printer file et
form "formname"
printer reset


Except in real life I never use a hardcoded static filename like that so
that multiple users can't step on each other, and I don't leave temp output
files lying around after use, and I put most of that into gosubs so it
really looks more like this:


gosub prset
form "formname"
gosub pfe


prset:'print file setup
printer reset
declare printfile(256,,g)
printfile = getenv("PFTMP"){"/"{@fi{@rn{getenv("LOGNAME"){rand()
system noredraw "umask 0;>" { printfile
printer type "hplaser"
printer file printfile
return

pfe:' print/fax/email
printer reset
system "d" < printfile
x = remove(printfile)
return


"d" is just a (poorly named) thing of our own that takes a filename and
prints it, faxes it, emails it, puts it into a pdf, displays it in a browser
etc, either interactively with a menu or non interactively controlled by
environment variables. You wouldn't literally use that line. It just serves
to show what order to do things in. Where I have system "d" < printfile  you
would have whatever you need to do with the file.

--
bkw
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes
http://mailman.celestial.com/mailman/listinfo/filepro-list



More information about the Filepro-list mailing list