[REBOL] Re: Removal or exclusion ?
From: nitsch-lists:netcologne at: 8-Jul-2003 9:14
Am Dienstag, 8. Juli 2003 02:19 schrieb Anton:
> How about:
> =09insert clear list-data exclude list-data mylist/picked
Thought that myself, but you clear the list-data before you exclude..
In Patricks example, the remove-each looks cleaner.
Efficience should not matter here.
> > Hi list
> > In terms of elegance and efficiency, which one do you choose ?
> > remove-each or exclude ? or a third solution ?
> > My problem is to remove all the selected items of a text-list
> > from the list-data. I have got two ways to do that:
> > (1) remove-each x list-data [found? find mylist/picked x]
> > (2) s-temp: exclude list-data mylist/picked clear list-data
> > append list-data s-temp
> > Unfortunately, in this particular case, one cannot use
> > "list-data: exclude list-data mylist/picked" because the
> > resulting block is not associated to the list anymore.
> > The test example...
> > list-data: ["red" "green" "blue" "yellow" "white"]
> > lay: layout [
> > mylist: text-list 200x200 data list-data
> > button "Remove selected" 200 [
> > ; remove-each x list-data [found? find mylist/picked x]
> > s-temp: exclude list-data mylist/picked clear list-data append
> > list-data s-temp
> > show mylist
> > ]
> > ]
> > view center-face lay
> > Regards
> > Patrick