Try this:

        view layout [t: text-list "hello" "there" "hello" "anton"]

(Now click on the first item)

        >> t/picked
        == ["hello"]
        >> t/data
        == ["hello" "there" "hello" "anton"]
        >> find t/data t/picked/1
        == ["hello" "there" "hello" "anton"]
        >> index? find t/data t/picked/1
        == 1

One problem with text-lists is that if you have
more than one item with an equal value, then
when you pick one, the other ones will also be
picked.
So it's good/necessary to ensure you have unique
values in your text-list.

        eg. This list is problematic:

                hello
                there
                hello
                anton

If you pick the first "hello", the second one
will also be shown as selected, and vice versa,
if you pick the second one, the first one is also
shown as selected.
This means that if your values are not unique,
then it is difficult to find the index in the
series by using:

        index? find series value

because you may have intended only the second
value to be picked.
A possible solution is to ensure your values are unique
by adding an index number to the beginning of each
string (or a number of invisible whitespaces at the end of
secondary instances of values).

Anton.

> I have a text-list in a layout whos order corresponds to the order of a
> series.  ie element 2 of the text-list corresponds to element 2 of the
> series.  I want to be able to remove an element from the
> text-list and have
> the corresponding element in the series removed as well.  What I can't
> figure out is how to find out the position of the currently
> selected element
> in the text-list.  If I could find that then I could just issue something
> like
>
> i: text-list-position
> s: skip s i
> remove s
>
> where s is the series I am trying to alter
>
> thanks,
>
> Matt

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to