TList indexing?

BlitzMax Forums/BlitzMax Programming/TList indexing?

If you want a dynamically-growing array you *could* make an array wrapped in a type that uses slicing to increase its size every time the limit is reached, something like (entirely untested):

Type GrowingArray
  Field Array[100]
  Field Pointer

  Method New()
     Pointer = 0
  End Method

  Method AddElement(NewElement)
     if Pointer = Len(Array)-1
        Array = Array[..Int(Len(Array)*1.5)]
     endif
     Array[Pointer] = NewElement
     Pointer :+ 1
  End Method
End Type

...but there are various reasons it might not be appropriate, just throwing it out there.