How to suppress "index out of range" error
I am executing a wave assignment that generates an "index out of range" error:
futureTrue = futureFOG_PMinTask * FOG_Merged_InTask[p+128]
As the help file says, Igor handles this by using the shorter wave's last value for the "out-of-range" portion needed:
"...If wave2 has fewer points than wave1 then Igor will try to evaluate wave2[p] for values of p greater than the length of wave2. In this case, it returns the value of the last point in wave2 during the wave assignment statement but also raises an "index out of range" error. Previous versions of Igor did not raise this error..."
This is fine for my calculations. However, I want to run my routine multiple times automatically, and this error requires the user to click "Ok" to proceed. I can suppress the error by turning off "Debug on error". But then I have to remember to turn this back on later.
Is there another way to suppress the error message?
I think this will work:
futureTrue = futureFOG_PMinTask * FOG_Merged_InTask[min(p+128,lastPoint)]
September 23, 2023 at 08:49 pm - Permalink
In reply to I think this will work: … by hrodstein
...very clever! Thank you.
September 24, 2023 at 05:14 am - Permalink