not foobar lookup problem

Kenneth Brody kenbrody at bestweb.net
Fri Nov 21 07:25:57 PST 2008


Quoting RKreiss1 (Thu, 20 Nov 2008 18:39:55 -0500):

[...]
>> > Since the only change I made on the program lookup line was to change
> sales
>> > to salej, and the lookup worked, I have to assume that the problem is
> with
>> > the alias.
>>
>> The above sentence contains the root cause of your problem.
> (Specifically,
>> why you believe changing the alias changed whether the lookup succeeded or
>> failed.)  Do you see it?
> If you are referring to sales to salej, then my problem was the alias to
> start with.

No, I am referring to the fact that you say the only change you made was
to the lookup alias.  You didn't say you also changed the "not sales" test.

> It has always been suggested that the alias for a file be kept consistent as
> each different alias opens a new handle.

By "handle", I assume you mean a handle to an open file?

No, all lookups to the same file share the same resources, such as open
file handles, record layout definition (ie: the parsed map), index buffers,
and so on.

Whether you use the same alias or a different one depends on the program.

Sometimes, you need to use the same one:

     You have several different lookups, to find a record by one of several
     different methods (perhaps one by client number, another by name), and
     then you have code that uses the data the same way, regardless of how
     it was found.

Other times you need to use different ones

     You have two lookups to the same file, but to different records, and
     you need to refer to both of the records.

And other times it makes no difference.

>  By you previous remark, I assume
> that no handle is generated unless the lookup line is executed.

The file would be opened by the first lookup to that file that gets
executed.  (Or, reopened by the first one to be executed after you close
the file.)

>> Unless, that is, there are other details about the change(s) you made, but
>> failed to mention.
>
> Only Change made was to the alias.  Of course, the lookup values were
> changed to match sales(nn) to salej(nn).

You still haven't mentioned the "not sales" test.

As I have said, changing the alias will have no effect on whether the
lookup succeeds or fails.  (Changing the alias on the lookup, not but
on the test, will of course make a difference on the test.)

>> > CCP_CODE is what I expected it to be, the values from the record
> mark(16)
>> > which is in the form NNNN-NNNNN.
>
>> >
>> > With the debugger on, I checked the value.  Opened the sales journal and
>> > entered the value into index C and got to the expected record.
>>
>> Are you sure you're using the exact same value in dclerk's index prompt as
>> is in the ccp_code variable used in the lookup?
>
> Field 4 in sales journal is (10,ccp) as is ccp_code.

And the exact value of ccp_code when you execute the lookup is ...?
And the exact value you typed into the "index by" prompt in dclerk is ...?
And the exact definition of the "ccp" edit is ...?

[...]
> The fix worked but if what you say is true, then I still don't understand
> why.

Some detail has not yet been revealed about the exact situation.

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