Hello again,
Sorry i'have an other question (but believe me i search a lot before asking)
I'm sure that it's easy but i can't find the right grammar.
I would like to add a variable into a variable name
Like
I mean i would like to be able to add variable into the an other variable name like
for i = 1 to 5 do (
var_number_[i] = "hello"
)
print var_number_1
print var_number_2
print var_number_3
In my case i've that to short
macroscript Light category:"gabi"
(
rollout lumiere "Gestion de light"
(
group "Group"
(
radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
)
button ajout "Add selection to group" width:210 height:25 align:#center
On ajout pressed do
(
if groupe.state == 1 do
(
sel_courante = selection as array
lum1 = lum1 + sel_courante
makeUniqueArray (lum1)
utilitaire = for s in lum1 collect s.name
liste_lum1.items = utilitaire
)
if groupe.state == 2 do
(
sel_courante = selection as array
lum2 = lum2 + sel_courante
makeUniqueArray (lum2)
utilitaire = for s in lum2 collect s.name
liste_lum2.items = utilitaire
)
if groupe.state == 3 do
(
sel_courante = selection as array
lum3 = lum3 + sel_courante
makeUniqueArray (lum3)
utilitaire = for s in lum3 collect s.name
liste_lum3.items = utilitaire
)
if groupe.state == 4 do
(
sel_courante = selection as array
lum4 = lum4 + sel_courante
makeUniqueArray (lum4)
utilitaire = for s in lum4 collect s.name
liste_lum4.items = utilitaire
)
)
)
createdialog lumiere width:600 height:600
)
And i would like to do something like that
macroscript Light category:"gabi"
(
rollout lumiere "Gestion de light"
(
group "Group"
(
radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
)
button ajout "Add selection to group" width:210 height:25 align:#center
On ajout pressed do
(
sel_courante = selection as array
lum[group.state] = lum[group.state] + sel_courante
makeUniqueArray(lum[group.state])
utilitaire = for s in lum[group.state] collect s.name
liste_lum[group.state].items = utilitaire
)
)
createdialog lumiere width:600 height:600
)
thank for any help
miauu · 2012-11-04