Igor 7 problem with string waves

Hi,


the following function has worked well for over 10 years. Since I upgraded to Igor 7, it does not compile any longer. Under Igor 7 strlen(w[i]) generates the error message:

got "w" instead of a string variable or string function name.

Well, I have w declared as a string wave, so w[i] should be a string. What is wrong here?

function RemoveEmptyLines(w)
    wave/S w
    variable i = 0
    do
        if (strlen(w[i]) ==0)
            Deletepoints i,1,w
        else
            i += 1
        endif
    while (i<numpnts(w))
end



Best regards,
Joerg.

PS: For problems like this, a downgrade button to Igor 6 would be very useful.


Hi,

I think you need to /T in your wave declaration.
Wave /T w

instead

Wave /S w


Andy
Igor 6 seems to be still working fine. That saves my day. Sorry for the downgrade comment.
That your original code compiles at all in IP6 is probably a mistake, since you're declaraing the wave reference as a single precision numeric type but then treating it as a text wave.

As for a "Downgrade Button", you can install IP6 and IP7 on the same machine and use them both if you need to. If you are getting compile errors in IP7 that you did not get with the same code in IP6, it's likely that your code is either very old or has a mistake in it. If it's a mistake, it's possible that you got the results you expected in IP6 even with that mistake (that appears to be the case here) but that's not always the case.
I can not resist to point out that rewriting it as

Function RemoveEmptyLines(w)
    Wave/T wv

    Extract/O w, w, strlen(w) > 0
End


should be much faster.