How to get the index of a text-list
[1/3] from: g_pizzetta::bluewin::ch at: 4-Oct-2002 9:36
hello
When you use a text-list, you can get the value of the line you click on by using the
word VALUE
Exemple:
text-list "rob" "bill" "Pierre" "robin" [ print value ]
if you click on pierre when the list is displayed, you get:
PIERRE
How can you get: 3
Thank'y a lot, Gilles
[2/3] from: rebol:optushome:au at: 4-Oct-2002 18:34
Hi Giles,
view layout [
text-list "rob" "bill" "Pierre" "robin" [
print index? find face/data value
]
]
or if you prefer to separate your data block from the layout
names: ["rob" "bill" "Pierre" "robin"]
view layout [
text-list data names [
print index? find face/data value
]
]
Cheers,
Allen K
[3/3] from: carl:cybercraft at: 4-Oct-2002 20:58
On 04-Oct-02, g wrote:
> hello
> When you use a text-list, you can get the value of the line you
<<quoted lines omitted: 4>>
> How can you get: 3
> Thank'y a lot, Gilles
Hi Gilles,
You could do something like this...
people: ["rob" "bill" "Pierre" "robin"]
view layout [
text-list data people [
print index? find people value
]
]
Not sure if the index of the picked item is stored anywhere in
text-list. It may not be, as you can select more than one item in a
text-list using Ctrl.
HTH.
--
Carl Read
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted