Hi,
i do have a few questions to arrays:
a) How do i define an multidimensional array and access specific values in them?
Okay i have this working:
local dum:float[][]=[[1.0,2.0,3.0,4.0,5.0,6.0],[7.0,8.0,9.0,10.0,11.0,12.0],[13.0,14.0,15.0,16.0,17.0,18.0]]
print dum[2][5]
But can i also define it like this?
local dum:float[3,6]=?
or
local dum:float[3,6]
dum[0]=[1.0,2.0,3.0,4.0,5.0,6.0]
dum[1]=[7.0,8.0,9.0,10.0,11.0,12.0]
dum[2]=[13.0,14.0,15.0,16.0,17.0,18.0]
Same way of accessing specific values in such a scenario?
b) If defining longer lists for an array is there any continue sign so that i can break up my code for better readability?
I mean something like a "/" in this example:
local dum:float[][]=[/
[1.0,2.0,3.0,4.0,5.0,6.0],/
[7.0,8.0,9.0,10.0,11.0,12.0],/
[13.0,14.0,15.0,16.0,17.0,18.0]]
Btw it would really be nice if i also could pass "1" or a "1." instead of "1.0" when using floats.
Greetings,
taumel
i do have a few questions to arrays:
a) How do i define an multidimensional array and access specific values in them?
Okay i have this working:
local dum:float[][]=[[1.0,2.0,3.0,4.0,5.0,6.0],[7.0,8.0,9.0,10.0,11.0,12.0],[13.0,14.0,15.0,16.0,17.0,18.0]]
print dum[2][5]
But can i also define it like this?
local dum:float[3,6]=?
or
local dum:float[3,6]
dum[0]=[1.0,2.0,3.0,4.0,5.0,6.0]
dum[1]=[7.0,8.0,9.0,10.0,11.0,12.0]
dum[2]=[13.0,14.0,15.0,16.0,17.0,18.0]
Same way of accessing specific values in such a scenario?
b) If defining longer lists for an array is there any continue sign so that i can break up my code for better readability?
I mean something like a "/" in this example:
local dum:float[][]=[/
[1.0,2.0,3.0,4.0,5.0,6.0],/
[7.0,8.0,9.0,10.0,11.0,12.0],/
[13.0,14.0,15.0,16.0,17.0,18.0]]
Btw it would really be nice if i also could pass "1" or a "1." instead of "1.0" when using floats.
Greetings,
taumel