Some of you were curious about the "Array_NextIndex" and "Array_PrevIndex" functions and their use cases. It basically simplifies getting the next or previous valid index of the array.
In the case for "Array_NextIndex" --
- If the array is not valid, return -1 (INDEX_NONE).
- If the next index is less than 0, return 0.
- If the next index is less than or equal to the last index, return the next index.
- If the next index is greater than the last index, and bLoop is enabled, return 0. Otherwise, return the last index.
An example use-case would be an event driven incrementation, such as a UI carousel or moving to the next destination.