Arrays

BlitzMax Forums/BlitzMax Programming/Arrays

splinux(Posted 2006) [#1]
I have a problem with arrays.

I need to declare a multidimensional array within a type(
and i write

field arr:float[]


)

Then i would need to adjust its dimensions when the type is created:

arr=new float[x, y]



Does anyone know how to bypass this problem?

Any code is well accepted.
Thank you to all.


Perturbatio(Posted 2006) [#2]
field arr:float[,]


splinux(Posted 2006) [#3]
Wow, that's very interesting.
Thank you, Perturbatio.


Perturbatio(Posted 2006) [#4]
SuperStrict

Type test
	Field arr:Int[,]
	
	Function create:test(x:Int,y:Int)
		Local tempTest:test = New test
			tempTest.arr = New Int[x,y]
		Return tempTest
	End Function
	
End Type

Local t:test = test.create(10,10)

t.arr[0,0] = 100

Print t.arr[0,0]