Interpolate2 error popup when used in user-defined function

I tried to make an evenly spaced wave using Interpolate2.

While I do not encounter any error message when this is done from the command line, I get error messages "While executing a wave read, the following error occurred: Index out of range for wave" when used in a user-defined function.

It seems that the calculation is done properly, so is there any way to get rid of this error message from popping up?

Please post a simplified, self-contained function that illustrates the problem so we can investigate the issue.

 

You are not providing very much information. It would be much easier to help you if you could tell us a bit more, for example, what you entered into the command line or how your user function looks.

Anyway, I suspect some wave indexing runs further than there are points in your data wave (even if it's only one point over the edge). Igor is telling you with the error message that you are trying to read data which is simply not there, since the addressing is out-of-bounds. This may or may not lead to any (visible) bad behavior. Error checking like this can be adjusted with the #pragma rtGlobals compiler directive. I guess you have rtGlobals=3 in your procedure file. Set it to rtGlobals=1 and the error message will go away, since Igor will not care anymore. Or you could fix your function call (we may be able to help with that as well).