***SPAM*** Re: odd lookup problem

Kenneth Brody kenbrody at spamcop.net
Mon Nov 8 11:21:58 PST 2010


On 11/8/2010 9:43 AM, Richard Kreiss wrote:
[...]
>>> 192  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>>          ◄ If:
>>>          Then: lv=master_code&"99"
>>> 193  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>>          ◄ If:
>>>          Then: lookup SALES = sales_journal  k=16   i=C -nL
>>> 194  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>>          ◄ If:         NOT sales
>>>          Then:         GOTO make_zv
>>> 195  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>>>          ◄ If:         SALES  and sales(3) = master_code
>>>          Then:         GOTO next_w
[...]
> First version on master_code, field 16, worked.  The problem is I need to check for the latest sales journal record, not just the existence of a record.  This required that I change the key to use the master_code and renewal number.  Since the renewal number is not known,  master_code&"99" with a lookup to the next lowest match.

Okay.  But, in the examples you showed, you also changed from using field 16 
as the lookup key to using master_code&"99".  (ie: rather than using field 
16, you are now using field master_code.)

> As I indicated, when I made the change, the if SALES right after the lookup statement showed false and dropped through to no sales journal record, make sales routine.

You didn't answer my questions regarding fields 16 and master_code, as well 
as what's actually in the lookup key and in the sales_journal file.

> When not sales was added after the lookup statement and before the if: sales, and there were records found, the if SALES line showed true.

As is expected.  If the lookup succeeds, "if: sales" will be true, and "if: 
not sales" would be false.  The reverse is true if the lookup fails.

> What I am asking is, why should it be necessary to have a not sales before the if sales when doing a lookup to the next lowest match?

You haven't shown any code where the only change was the addition of "if: 
not sales", so there's no way to answer that.

-- 
Kenneth Brody


More information about the Filepro-list mailing list