How do I create multiple of the same type?

Blitz3D Forums/Blitz3D Beginners Area/How do I create multiple of the same 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.

While the code big10p gave you is, as you asked, exactly like the C source, we should probably mention that you can iterate through automatically generated lists of type instances also (which basically cuts out having to use fixed size arrays):
Type dataT        ; 'data' is a reserved word.
  Field x%, y%
End Type
currentDataT.dataT=Null; declarations are good


For i = 0 To 9
  currentDataT = New dataT
  currentDataT\x = i
  currentDataT\y = i*2
Next

;iterate through list of instances
For currentDataT = Each dataT
	Print currentDataT\x+","+currentDataT\y
Next

WaitKey


Linked lists are pretty useful for games programming and you'll probably end up adopting them sooner or later.