Help with variables in Types

BlitzPlus Forums/BlitzPlus Beginners Area/Help with variables in Types

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.

What I would do is store your x and y variables in an array, then do something like this:

Dim coordinates(5,2)
coordinates(0,0)=10 ;an x coordinate
coordinates(0,1)=20 ;a y coordinate
coordinates(1,0)=223 ;another x coordinate
coordinates(1,1)=224 ;another y coordinate
;etc.  fill your entire array in this fashion...

Type OBJ
	Field X,Y
End Type

OBJNUM=5
For f=0 to OBJNUM
	THIS.OBJ=New OBJ
	THIS.OBJ\X = coordinates(f,0)
	THIS.OBJ\Y = coordinates(f,1)
Next