One thing that is worthy of mention at this point, is that the in-built error checking, i.e. have we addressed an area outside of the array dimensions, ONLY works for unique array tags.
If the array in question is part of a UDT structure, and not the last part, then an "illegal" array index WILL stomp on, or read from, whatever is in memory after the array.
In other words, the in-built error checking ONLY looks to see if you are trying to address OUTSIDE of the TAG, and in the case of a UDT tag, you could have lots of corruption going on, and you'd never spot it, because the processor doesn't fault out.
It is wise therefore, to use any means possible to range test or limit the array index before you use it
If the array in question is part of a UDT structure, and not the last part, then an "illegal" array index WILL stomp on, or read from, whatever is in memory after the array.
In other words, the in-built error checking ONLY looks to see if you are trying to address OUTSIDE of the TAG, and in the case of a UDT tag, you could have lots of corruption going on, and you'd never spot it, because the processor doesn't fault out.
It is wise therefore, to use any means possible to range test or limit the array index before you use it