Lookups in input processing

Jeff Harrison jeffaharrison at yahoo.com
Wed Feb 2 17:16:54 PST 2005


--- Mitch Theophila/MGT Computer Solutions
<theophila at compuserve.com> wrote:

[snip]
> 
> they would like an enhancement to their application
> as follows:  When they 
> begin to enter a new invoice for a customer, they
> want to know if that customer 
> has any open invoices outstanding, and be given the
> option to proceed (or not) 
> with the new invoice.  They envision seeing this
> information in a prompt or 
> message box that appears near the beginning of the
> new-invoice process, 
> immediately after they specify which customer they
> are invoicing.  A y/n 
> response would determine whether the new invoice
> should be created.
> 
[snip]

It sounds like Ken answered your original question. 
However, I thought that I would comment on how you
might approach this logic.  If you only care about
positive balances then this could be done with one
lookup.  Just build your index in your invoice file on
the customer number and the balance.  Then build your
lookup key as follows:

Then: cn=1     ' (customer number)
Then: bl=".01"
Then: lookup etc = filename k=(cn&bl) i=a -bg
If: etc and cn eq etc(1)
Then: msgbox "Customer has a current positive balance"

If you also care about negative balances, then add
another lookup with "-.01" as the value for bl and
make the lookup flag -bl.  In both cases make sure
that if the lookup is successful that the customer
number also matches.

Good Luck.

Jeff Harrison
jeffaharrison at yahoo.com

Author of JHImport and JHExport. The fastest and
easiest way to create code for filePro Imports and
Exports. 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Filepro-list mailing list