Another 'Type' problem

Blitz3D Forums/Blitz3D Beginners Area/Another 'Type' problem

But you don't have a 3-dimensional array... you've got a list of 1000 myTypes. The first one has x_pos=1, y_pos=1, z_pos=1, the second one has x_pos=1, y_pos=1, z_pos=2, the eleventh one has x_pos=1, y_pos=2, z_pos=1, etc, all the way to #1000, which has x_pos=10, y_pos=10, z_pos=10.

Also, you've got one declared myType pointer, "m", which is currently pointing to the last myType you created (the same as "Last myType").

You would have to iterate through the list to get the one you wanted, since you didn't save any pointers.
m.myType = First myType
for i = 1 to <whatever> : m = After m : Next


What you could do is create an array for myType pointers, so you could have directo access to any of them.
Type myType
	Field x_pos
	Field y_pos
	Field z_pos
End Type

Dim t.MyType(10,10,10)
For x = 1 To 10
	For y = 1 To 10
		For z = 1 To 10
			t(x,y,z) = New myType
			t(x,y,z)\x_pos = x
			t(x,y,z)\y_pos = y
			t(x,y,z)\z_pos = z
		Next
	Next
Next


Now, you still have the list of 1000 types, but instead of just one type pointer ("m") pointing to the last one you created, you've got 1000 type pointers in the "t" 3-dimensional array that you can access.