Output processing, lookups, and system calls

John Esak john at valar.com
Tue Aug 23 17:07:33 PDT 2005


> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of Dave
> Burris
> Sent: Tuesday, August 23, 2005 6:00 PM
> To: filepro-list at seaslug.org
> Subject: Output processing, lookups, and system calls
>
>
> Hello,
>
> filePro v5.0.11D4 on OpenServer 5.0.6
>
> I have a report that prints invoices to a file in ascii and then runs a
> system call to convert the file to pdf format.  However, if I run a
> lookup and getnext command prior to running the system call to create
> the pdf file, the system call fails.  If I comment out the lookup and
> getnext commands, the system call succeeds and the pdf is created.  Is
> there are rule about using lookups in output processing?
>
> Below is the code with the lookup and getnext command.  It iterates
> through each invoice line item and prints out the taxable items.
>
> Thanks,
> Dave Burris
>
> taxitms:'Retrieve the taxable line items and print them::
> ::lookup items = kwb_invoice_line_item k=1 i=E -nx:
> :not items 'No hardware or software:return:
> ::gosub taxitem:
> :'Print the materials subtotal:gosub mater:
> ::pt="":
> ::return:
> taxitem:'Iterate through and print the taxable items only::
> :not items:close items; return:
> :items(2) ne 1:close items; return:
> :items(9) eq "N" 'Only print the taxable items:getnext items;
> goto taxitem:
> :'Set the variables and print:pt=items(3)&" "&items(5)&" "&items(4)&"
> "&items(6):
> ::print:
> :items(11) ne "" 'If shipping & handling exist, print an indented
> line:pt=" SHIPPING "&items(11); print:
> ::getnext items; goto taxitem:
>

Dave,
I looked at your code and see nothing wrong with it. There are two "not
items" lines when you could do this more easily with just one. Also, you do
the subroutine without first checking to see if you have a record which
needs the subroutine. You *do* check in the subroutine to see if items(2) ne
1, but you could do this just below the first "not items" and have things
read a little more clearly.  In other words, there is no reason to use the
"taxitem" subroutine, the getnext code would accomplish what you want
without it. However, I think this code would still work...  So, I think
there is some other problem going on.

Meaning, if this code were being done in *clerk, the PRINT would function as
I think you expect it to work here. Otherwise, if you are running this in
*report as you say, the PRINT might give you some strange results. I think
what you would want to be using in this case is FORM. I don't think the
PRINT command is meant to be used more than once in output processing.
Could be wrong about this, maybe, but I think this is where the problem
lies.

John



--
John Esak
Visit The FP Room www.tinyurl.com/97y9u 24/7

Author of:
The filePro Survivor Series
Complete video training on CD for filePro.
Samples at: www.valar.com/training



More information about the Filepro-list mailing list