For about a year I've been removing from dynamic arrays with the same code, but for the past 2 weeks I discovered it did not work properly in one of my arrays, but not through any doing of mine. It seems there is an rare and strange bug within AGK.
Essentially I,
if ID <> size-1 (I treat arrays as 0 to size-1)
for n = ID to size-1-1
arr[n] = arr[n+1]
next n
endif
size = size-1
dim arr[size] as some_UDT
yet it shifts improperly for one of my arrays. Yet if I,
if ID <> size-1
for n = ID to size-1-1
arr[n].value = arr[n+1].value
arr[n].otherValue = arr[n+1].otherValue
//and so on
next n
endif
size = size-1
dim arr[size] as some_UDT
then it works properly. I'm using the most recent stable AppGameKit 1 build. I thought these bugs had been fixed, but perhaps not (or I've made a mistake so foolish I haven't noticed XD) It seems assigning types to types doesn't work 100% of the time. It's irritating to have to copy every value over, but I'd suggest doing that for the time being. So, am I crazy? I don't know how to replicate the error without reproducing all of my code as is (it's about 1200 lines atm). I did not touch this piece of code and originally it was working fine for the problem array, but as the project grew, it appeared from thin air