Example

Getting A Text List Value

Author: r v.d.Zee
This example requires REBOL/View
Return to REBOL Cookbook

To obtain the value of item in the REBOL/View text list selected (picked) by the user, use the TEXT-LIST/PICKED field.


    view layout [
        backdrop silver
        city-list: text-list "Sydney" "Tokyo" "Ottawa" [
            see-it/text: form city-list/picked
            show see-it
        ]
        see-it: info
    ]

The picked FIELD is a block of current selections (there may be more than one). Use FIRST if all you want is one:


    view layout [
        backdrop silver
        city-list: text-list "Sydney" "Tokyo" "Ottawa" [
            see-it/text: first city-list/picked
            show see-it
        ]
        see-it: info
    ]

2006 REBOL Technologies REBOL.com REBOL.net