Type Arrays.

Blitz3D Forums/Blitz3D Programming/Type Arrays.

Colvette(Posted 2006) [#1]
How can I do these in Blitz? I can't seem to declare them, and it looks like I can't use a bank to do them either, but I need to use something like this, otherwise I'm floating around with loads of variables!

Sorry about this - I'm a C coder originally, so the transition to Blitz is proving to be a little problematic! :)


Jazz(Posted 2006) [#2]
I'm a C coder myself, welcome to Blitz 3D. :)

Is this what you were looking for?
http://www.blitzbasic.com/codearcs/codearcs.php?code=417


tonyg(Posted 2006) [#3]
There are arrays of types (as above) or type arrays.
type arrays


Kev(Posted 2006) [#4]
Type car
	Field x
End Type

Dim cars.car(200)

For loop = 0 To 20
	cars(loop) = New car
	cars(loop)\x = Rnd(5,10)
Next

For loop = 0 To 20
	Print cars(loop)\x
Next

MouseWait
End



Colvette(Posted 2006) [#5]
Nice one, fellas! Thanks! :)