Error handling G0058 : Index out of range

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.

Thank you

1 Answer



0



Is there a reason you cannot set the number of iterations based on the size of the data you are indexing?

For example:

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.

aptech

1,773

Your Answer

1 Answer

0

Is there a reason you cannot set the number of iterations based on the size of the data you are indexing?

For example:

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.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.