not foobar lookup problem

GCC Consulting gccconsulting at comcast.net
Thu Nov 20 09:06:35 PST 2008



> -----Original Message-----
> From: filepro-list-bounces+gccconsulting=comcast.net at lists.celestial.com
>
[mailto:filepro-list-bounces+gccconsulting=comcast.net at lists.celestial.com]
On
> Behalf Of Kenneth Brody
> Sent: Thursday, November 20, 2008 11:37 AM
> To: rkreiss1 at comcast.net
> Cc: filepro-list at lists.celestial.com
> Subject: RE: not foobar lookup problem
> 
> Quoting RKreiss1 (Thu, 20 Nov 2008 11:27:32 -0500):
> 
> > OK replace foo for sales.  That is the actual alias I used not foo.
> >
> >
> > 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.

Further down the table

Lookup sales=sales_journal  r=free  -n

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

As I previously indicated, at the not sales above, using the debugger showed
that this was true.  The lookup did not find the record which actually
existed in the sales_journal using the ccp_code.  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.

When I changed sales to salej the lookup executed properly.

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.

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.  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.

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?

Richard





> 
> [...]
> 
> In any case, there is nothing wrong with having multiple uses of the same
> alias.  The last one executed is the one that is used.  Given your
original
> example:
> 
>      Lookup foo=foobar  k=mc   i=c -xn
>      Not foo
>      END
>      More programming
> 
> The "not foo" line refers to the lookup on the line immediately preceding
> it.  If that lookup succeeds, as you say it does, then "not foo" will be
> false, regardless of any other uses of that alias, or lookups to that
> same file with different aliases.
> 
> Perhaps you should give the actual code which you say is failing, rather
> than your pseudo-code example?
> 
> --
> KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
> http://www.hvcomputer.com
> http://www.fileProPlus.com
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list




More information about the Filepro-list mailing list