Saving a Free wave


I am saving some waves to a single delimited text wave using this command in a function
Save/O/J/W/U={0,0,1,0}/B /P=outputfolder Errorlist as ResultFileName+"_Repair List.txt"

where Errorless is a list of waves. If I try to add the name of a wave created by a Duplicate/FREE command I get an error saying expecting wave name.

I had just used the name of the wave as declared by the duplicate function. (Note I perform some operations on the free wave so I can use the original source wave).

I add the name to string list by errorlist += "Cwave;" Should I use a different name syntax since it is a free wave?

If you use a string list of wave names (which requires /B) like your ErrorList parameter, the list must contain the names of the waves in the global context.

You can't use local WAVE reference names in there. This shows why it won't work:

Function foo()

    Make/O/FREE/N=10 freeWave=p
    String nm= NameOfWave(freeWave)
    String waves="freeWave;"
    Save/J/B waves as "Test.dat"

The debugger will show you that the name of the wave referred to by freeWave is actually "_free_".
And if you had multiple free waves, they would all have that name.

Save global duplicates of the free waves, instead.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.