not foobar lookup problem
Kenneth Brody
kenbrody at bestweb.net
Thu Nov 20 12:04:06 PST 2008
Quoting GCC Consulting (Thu, 20 Nov 2008 12:06:35 -0500):
[...]
>> > Ken, are lookup files opened when the input table is loaded even though
>> > the program line to execute the lookup has not been executed?
>>
>> No. The files are opened when the lookup is executed.
>>
>> > Based on what has happened, it appears to be so.
>>
>> Why do you say that?
>
> Let's see. I have a lookup to the file sales_journal using the alias sales
>
> Lookup sales=sales_journal k=master_code -I=C -xn
>
> In one place in the input table. This lookup is executed with An @key
> command.
Okay.
> Further down the table
>
> Lookup sales=sales_journal r=free -n
Okay.
> So, I add a new routine which is using a different master_code to get a
> record from the sales_journal file.
>
> Lookup sales=sales_journal k=ccp_code -I=C -xn
> NOT sales
> END 'as this is part of a drop routine, programming returns to
> the browse function
Okay.
So, you have three lookups to sales_journal, all with the "sales" alias.
> As I previously indicated, at the not sales above, using the debugger showed
> that this was true.
Which means that the lookup with "k=ccp_code" failed.
> The lookup did not find the record which actually
> existed in the sales_journal using the ccp_code.
Well, the lookup failed. So, either that record doesn't exist, or there
is something wrong with index C.
> I had checked the sales
> journal file to insure that the ccp_code was actually present and could be
> accessed using index C in that file.
Are you sure that ccp_code is what you think it is?
> When I changed sales to salej the lookup executed properly.
No, it didn't. Changing the alias has absolutely no effect on how the
lookup is executed. It only effects which alias will point to that
lookup.
> I can only assume(bad word) that the first lookup executed in auto
> processing using the sales alias or having this in the input table caused
> the problem.
You assume wrong.
Also, I see nothing in your statements above that show why you believe that
the lookup file was opened when the input table was loaded, rather than
when the lookup was executed.
> One other thing, the new routine is part of the @keys sales routine. If I
> recall correctly, @key triggers auto processing to run first and then the
> @key programming.
Correct, because @key will take you into update mode, the record needs to
be read again.
> So, is it possible that since there is a lookup in auto
> processing using the alias sales using the current master_code, trying to do
> a lookup again using a different master_code in input processing will cause
> the lookup to fail.
No.
> This is what seems to have happened to me. If not, the why did the lookup
> using the sales alias fail and work when the alias was changed to salej?
It didn't. Something else is going on that is leading you to believe that
it did.
[...]
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list