Subject | RE: [IBO] Re: Query.Locate -with OrderingItems & OrderingLinks |
---|---|
Author | Michael Horne |
Post date | 2003-11-18T04:26:21Z |
>I am not trying to step through the dataset, just go to the first
> > TIB_Query.Locate is a valid method, if it cannot be used with
> > IB_Query, why is it there.
> >
> > But anyway, what I am trying to do, is to position to the
> > first occurrence of a value in a list of records. Is
> > there something else I should be using instead of Locate?
>
> One of us isn't understanding the other.
>
> Locate isn't designed to step you through the dataset one match after
> another relative to where your record pointer is.
>
occurrence, example:
* I have a dataset with fields "Salesperson", "ID"
* "Salesperson" has many repeats, "ID" is unique
* With OrderingItems of "salesperson, id; salesperson desc, id desc"
* I want to issue some command that will take me to the
first occurrence of a "salesperson"
* I thought "query.locate(('salesperson', 'GARY', [lopPartialKey,
lopFindNearest]);
* Would do so, but even though it takes me to a record
with "GARY", it is not the first.
* I only want to position to the first record with "GARY"
not step to the next from where I am.
Is there some other command I should be using? Do
I need to write some code that will cycle through the
records until it finds the right one (I can, I just
thought Locate was suppose to do that)?
Thanks
Michael L. Horne