Dynamic Arrays

Blitz3D Forums/Blitz3D Programming/Dynamic Arrays

Grovesy(Posted 2005) [#1]
Is it possible to have dynamic arrays? What i mean by this is create an array that can be made bigger at run time?

Cheers


Oddball(Posted 2005) [#2]
You can re-dim an array at anytime, but you will lose it's contents.


octothorpe(Posted 2005) [#3]
Blitz has two kinds of arrays: basic arrays (Dim a(10)) and type arrays (Field x[10]). The first kind is global and cannot be passed to functions, the second is limited to a static number of elements.

To get around the limitations of Blitz's arrays, you could use banks. Check out my solution: Container: vector


Grovesy(Posted 2005) [#4]
Cheers octothorpe. I'll take a look at that tonight! :)