Global array in type

BlitzMax Forums/BlitzMax Beginners Area/Global array in type

Don't size the array and create a new method that do this for you.

Type t
	Global a:Int[]
	Method New()
		a=a[..10]  ' Slice array to 10 elements (Dim)
	End Method
End Type


n:t=New t
n.a[0]=10
Print n.a[0]  ' Result 10
Print SizeOf t.a  ' Result 40 (4*10)


j:t=New t
Print j.a[0]  ' Result 10