My advice to you in terms or trying to access data outside of arrays is too have the array as a record or type, and a constant which tells you how long that array is. Then when you use loops to process data in that array, add a clause that breaks the loop when whatever position in the array you are processing is >= maximum length. That way you never get any crashes from processing data outside an array... It helps in debugging, especially if you have a lot of arrays, you can just rule that out in most cases. (unless you a clutz like me that defines an array 1..100 and then sets the limit to 250.... it took a while to find, trust me.)

hope this was useful,
code_glitch.