Limitless Array

BlitzMax Forums/BlitzMax Beginners Area/Limitless Array

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.

arrays can be resized at any time and don't need their size declared before using:

Local myArray:Int[]
Local i:Int

SeedRnd MilliSecs()

myArray = myArray[..10] ' give it 10 elements

For I = 0 To myArray.length
	myArray[i] = Rand(0,100)
Next

For I = 0 To myArray.length
	Print myArray[i]
Next


'resize to a random number

myArray = myArray[..Rand(10 , 100)]
Print "Array length: " + myArray.length