Variable size arrays as a field

BlitzMax Forums/BlitzMax Programming/Variable size arrays as a field

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.

Like this?
Type foo
Field grid[,]
Method Resize(w,h)

	Local temp:Int[w , h]
	If grid
		For Local x:Int = 0 Until w
			For Local y:Int = 0 Until h
				Print x + " " + y
				If grid[x,y]<>0
					temp[x,y] = grid[x,y]
				Else
					temp[x,y] = Null
				EndIf
			Next
		Next
	Else
		grid:Int=New Int[22,22]
	EndIf
EndMethod

EndType

f:foo = New foo
Print Len(f.grid)
f.resize(22 , 22)
Print Len(f.grid)