Newbie Q: Modifying Text-List
[1/4] from: blemeri:noos at: 20-Oct-2002 19:11
Hi,
I try to add items to a list bbl and the associated text-list:
bbl: [ "a" "b" "c" ]
view layout [
button "Add" bold
[ repend bbl copy t1/text
bbl: sort unique bbl
show cl
]
t1: area 340x280
cl: text-list data bbl
]
the text list is not updated after the second added item.
this script works fine without "bbl: sort unique bbl".
Anyone could give me a hint ?
(I found no response in Brett Vid/view notes)
Thx,
Bruno.
[2/4] from: greggirwin:mindspring at: 20-Oct-2002 13:05
Hi Bruno,
<< the text list is not updated after the second added item.
this script works fine without "bbl: sort unique bbl".
Anyone could give me a hint ? >>
Your text list is referencing the original *value* of bbl. When you use
UNIQUE, it generates a new *different* value which, while still referenced
by the word bbl, is not referenced by text-list/lines (which is still
looking that the original value). If you reset the reference for the
text-list after changing the data, all is well.
bbl: [ "a" "b" "c" ]
view layout [
button "Add" bold
[ repend bbl copy t1/text
cl/lines: bbl: sort unique bbl
show cl
]
t1: area 340x280
cl: text-list data bbl
]
HTH!
--Gregg
[3/4] from: gscottjones::mchsi::com at: 20-Oct-2002 14:14
From: "Bruno Lemeri"
> I try to add items to a list bbl and the associated text-list:
> bbl: [ "a" "b" "c" ]
<<quoted lines omitted: 11>>
> Anyone could give me a hint ?
> (I found no response in Brett Vid/view notes)
Hi, Bruno,
unique returns a new block that you have reassigned to bbl. cl/lines needs
to be repointed to this new block. (I don't know why it works the first
time only, though.) Hopefully this code works:
bbl: [ "a" "b" "c" ]
view layout [
button "Add" bold
[ repend bbl copy t1/text
bbl: sort unique bbl
cl/lines: :bbl
show cl
]
t1: area 340x280
cl: text-list data bbl
]
(Note well: this will change with the next /View/VID, where the /data path
will contain the block used by the text-list.)
HTH
--Scott Jones
[4/4] from: blemeri:noos at: 20-Oct-2002 22:54
Thank you Gregg and G. for this "cl/lines" and explanations.
Regards,
Bruno.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted