bhnh
02-09-2008, 03:45 PM
I'm trying to code a button to create incrementally-numbered arrays, so, for instance, pressing the button three times would create Array1, Array2, Array3, etc. Last night I tried the following:
i = 1
v[i] = #(1,2,3)
i+=1
v[i] = #(4,5,6,7,8)
i+=1
v[i] = #("A","B","C")
rollout c "Show"
(
spinner spn "array #" pos:[30,10] width:40 type:#integer range:[1,3,1]
spinner spn_2 "index #" pos:[100,10] width:40 type:#integer range:[1,3,1]
button btn "print"
on btn pressed do
(print v[spn.value][spn_2.value]
)
)
createDialog c 150 60
... and it worked just fine. I went to bed feeling rather smug.
This morning I've tried running the same script, and everytime a "v[i]" is encountered a No "put" function for undefined message is thrown. If I just plow ahead and press the "Print" button I get No "get" function for undefined.:scream:
Can anyone instruct me on how to construct this properly? Many thanks.
i = 1
v[i] = #(1,2,3)
i+=1
v[i] = #(4,5,6,7,8)
i+=1
v[i] = #("A","B","C")
rollout c "Show"
(
spinner spn "array #" pos:[30,10] width:40 type:#integer range:[1,3,1]
spinner spn_2 "index #" pos:[100,10] width:40 type:#integer range:[1,3,1]
button btn "print"
on btn pressed do
(print v[spn.value][spn_2.value]
)
)
createDialog c 150 60
... and it worked just fine. I went to bed feeling rather smug.
This morning I've tried running the same script, and everytime a "v[i]" is encountered a No "put" function for undefined message is thrown. If I just plow ahead and press the "Print" button I get No "get" function for undefined.:scream:
Can anyone instruct me on how to construct this properly? Many thanks.
