Global array in type

BlitzMax Forums/BlitzMax Beginners Area/Global array in type

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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