Adding/removing array elements?

BlitzMax Forums/BlitzMax Beginners Area/Adding/removing array elements?

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.

extending an array can be done with a slice:
Global numArray:Int[] = [1,2,3,4,5]
numArray = numArray[..7]
for Local i:Int = eachin numArray
   print i
next


you can't concatenate array slices however, so removing an element involves looping through the array, from the index you want to remove and copy the value in the next element to the current

I stuck some concatenate array functions in the code archives that might help though.