Is where a way to account for this error inside a for loop?
I.e. if (i) gets too high and is out of range, we break the loop.
Is there a reason you cannot set the number of iterations based on the size of the data you are indexing?
for i(1, rows(x), 1); z = x[i]; endfor;
will never return an
index out of range error, because the range of the loop is based on the size of the data.