#strict 3 global func ArrayErase(array& arr, int index) { if(index < GetLength(arr)) { for(var i = index; i < GetLength(arr) - 1; ++i) { arr[i] = arr[i + 1]; } SetLength(arr, GetLength(arr) - 1); } } global func ArrayEraseItem(array& arr, item, bool multiple) { var index, count = 0; while((index = GetIndexOf(item, arr)) != -1) { ArrayErase(arr, index); if(!multiple) { return index; } ++count; } return (!multiple && -1) || count; } global func ArrayInsert(array& arr, int index, value) { for(var i = GetLength(arr); i > index; --i) { arr[i] = arr[i - 1]; } arr[index] = value; } // only here for backwards compatibility; use arr[] = value directly global func ArrayAppend(array& arr, value) { arr[] = value; } // only here for backwards compatibility; use arr ..= append directly global func ArrayAppendArray(array& arr, array append) { arr ..= append; }