Subject | Re: FindIndex in OrderingLinks does not work |
---|---|
Author | Steve Fields |
Post date | 2008-11-05T00:55:28Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
true; otherwise their order will be simply arrival sequence. So - if
the Sorted property is set, your IB_Stringlist's Name=Value strings
will be in Name order, which will make FindIndex work faster.
(Actually, I never sort stringlists in my own code: I load them from
ib_cursors in the order I want them...)
count - 1. FindIndex returns the index number (in the var) and True
if the Name is found; otherwise it returns False and the initial Nil
that you sent in the var.
strings.Count > 0 before calling methods that refer to string objects.
Maybe you're getting the AV on OrderingLinks because you haven't any
OrderingItems defined.
dataset is 1, not zero.
What I really needed was a way to link a TIB_Grid with
a TIB_IncSearch so that when I clicked on a column to
sort the table it would cause the search field to
reflect the new OrderingLink fieldname.
How I actually arrived at a workable plan is the following
in the OnTitleClick of the grid associated with the search
field:
srchField.OrderingLink :=
TIB_Column(TheGrid.BuffFields[ACol - 1]).FieldName;
Thanks much Helen,
Steve
>Sorted property puts the strings into ascending alphanumeric order if
> At 11:59 AM 3/11/2008, you wrote:
> >Hi All,
> >
> > Has anyone been able to use the FindIndex function
> >in TIB_StringList that is in TIB_Query?
> >
> > At present I want to be able to select a sorting
> >field by program but the stringlist does not allow
> >the function FindIndex because the list is not sorted.
> >It crashes every time, of course.
>
> It's not that the list "is not sorted" that is causing the AV. The
true; otherwise their order will be simply arrival sequence. So - if
the Sorted property is set, your IB_Stringlist's Name=Value strings
will be in Name order, which will make FindIndex work faster.
(Actually, I never sort stringlists in my own code: I load them from
ib_cursors in the order I want them...)
>the list has an index of 0 and the last has an index of the strings
> All strings in stringlists are indexed, whereby the first string of
count - 1. FindIndex returns the index number (in the var) and True
if the Name is found; otherwise it returns False and the initial Nil
that you sent in the var.
>list. Make it a precaution with stringlists to test that the
> But you'll get an AV if you try to apply such methods to an empty
strings.Count > 0 before calling methods that refer to string objects.
Maybe you're getting the AV on OrderingLinks because you haven't any
OrderingItems defined.
>OrderingLinks to OrderingItems, the first OrderingItem defined for a
> BTW, to totally confuse us all, when you're mapping your
dataset is 1, not zero.
>I tried and put a sorted := true in and it works fine.
> Helen
>
What I really needed was a way to link a TIB_Grid with
a TIB_IncSearch so that when I clicked on a column to
sort the table it would cause the search field to
reflect the new OrderingLink fieldname.
How I actually arrived at a workable plan is the following
in the OnTitleClick of the grid associated with the search
field:
srchField.OrderingLink :=
TIB_Column(TheGrid.BuffFields[ACol - 1]).FieldName;
Thanks much Helen,
Steve