With normal arrays you'll get a typical out of bounds error message. Same thing if you have an array of UDT which consists of only a single variable. But if your UDT has 2 or more variables, accessing an array element outside of the allocated range will result in a generic app crash.
Even more strangely, after running this snippet multiple times, eventually it would run without any errors at all.
type thing
x as integer
y as integer
endtype
dim stuff[2] as thing
stuff[3].x = 1
end
Ok, now I'm confused. There's definitely a bug somewhere, but it seems inconsistent.
This reports subscript out of bounds:
type thing
x as integer
y as integer
endtype
dim stuff[1] as thing
stuff[5].x = 42
do
print(stuff[5].x)
sync()
loop
However, define the array with 2 instead of 1 element, and it'll run; despite the fact it's using the 5 index.
"You're all wrong. You're all idiots." ~Fluffy Rabbit