Rename free waves

One of the cool IP9 features is that free waves can now have names which greatly help with debugging. But what if the free wave comes from another function so you can't decide the name yourself? Well you can leverage the power of MoveWave and give it a new name. This touches a bit the dark corners of IP though.

Function RenameFreeWave()

    // create free wave with the name being the wave reference name
    Make/FREE=1 mywave
    // prints 'mywave'
    print NameOfWave(mywave)
    // create a free datafolder
    DFREF dfr = NewFreeDataFolder()
    // move the free wave into the free datafolder giving it a new name
    MoveWave mywave, dfr:$"newname"
    // prints 'newname'
    print NameOfWave(mywave)

    // the wave is still free
    // don't delete dfr though and just let it go out of scope

One might think that it was an oversight that Rename doesn't work with free waves, now that you can name free waves. But in fact, a decision was made to draw the line *somewhere*. In fact, there wasn't universal agreement that named free waves were a good thing! Since in our view, this was a feature to aid debugging, we felt like the need to provide a complete set of operations wasn't so compelling.

As usual, Thomas has found a tricky and creative way around a limitation!




Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More