problems with movewave

i have a problem with a command. i don´t know if it´s due to the update to mavericks or just a code problem. the issue is that, when i use the move wave command the wave does move from one folder to another and it´s renamed with the destination folder name. check the example.

function mueve_conchetumare()

setdatafolder root:
DFREF saveDFR=getdatafolderDFR()

make/O moviendo
newdatafolder/O/S destino

movewave root:moviendo, destino

setdatafolder saveDFR

end


the wave "moviendo" it´s renamed to "destino"
The problem is your use of the MoveWave command:

function mueve_conchetumare()
 
    setdatafolder root:
    DFREF saveDFR=getdatafolderDFR()
 
    make/O moviendo
    newdatafolder/O/S destino
 
//  movewave root:moviendo, destino
    movewave root:moviendo, :
 
    setdatafolder saveDFR
 
end

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
According to the documentation, MoveWave expects a source wave reference, a destination path, and optionally, a destination wave name.

You are giving it a source wave reference and a destination wave name because your second parameter, destino, is a name, not a path.

I would have expected Igor to flag this as an error but instead it is treating the missing path as : (current data folder) and destino as the optional wave name.

Here is how I would do it. Note that I removed the /S flag from NewDataFolder and that the second parameter is a path (starts with :):

Function Test()
    SetDataFolder root:
 
    Make/O moviendo
    NewDataFolder/O destino
 
    MoveWave root:moviendo, :destino:
End
thanks guys for your quick help.
Another question, can I use a DFref or a string as a reference to destination folder in a procedure?

Greetings
Quote:
can I use a DFref or a string as a reference to destination folder in a procedure?


You can use either but I recommend a DFREF.