So basically I have several of the same ui elements kinda like this:
checkbutton ckb1
checkbutton ckb2
--...
checkbutton ckb32
I want to be able to set properties in-mass. So essentially:
fn massPropertySet =(
i=1
while i<=32 do(
ckbi.state=false
i+=1
)
)
I also want to be able to have a single function that stores data into an array based on button suffix #, but I need to check the state of the button:
on ckb1 changed state do
(storeData(1))
on ckb2 changed state do
(storeData(2))
fn storeData num = (
if ckbnum.state then(
data[num] += <bitArray>
else
data[num] -= <bitArray>
)
--can work around with:
on ckb1 changed state do
(storeData(1 ckb1.state))
on ckb2 changed state do
(storeData(2 ckb2.state))
fn storeData num state= (
if state then(
data[num] += <bitArray>
else
data[num] -= <bitArray>
)
I tried storing the checkbuttons in an array but get and unknown system exception...
ckbArray=#(ckb1, ckb2)
So basically I need to be able to store the checkbuttons in an array, which doesn't look possible, or convert a string into a "checkbutton ui name" so I can refer to any checkbutton at will via index.
The latter is possible with scene objects, with the
<string> as namefunction. Is there a way to do so with ui elements?
barigazy · 2013-03-23