Is there a way to keep the original wave and the inverted wave?

Hello,

I have been using this code to invert a wave:

Menu "TracePopup"
"-" // separator divides this from built-in menu items
"Invert wave", /Q, InvertWave()
End

//**
// Invert the wave that the user selected. Note that this inverts the wave itself
// and not just the trace.
//*
Function InvertWave()
GetLastUserMenuInfo

// determine the wave name based on the trace name and window name
WAVE targetWave = TraceNameToWaveRef(S_graphName, S_traceName)
targetWave *= -1
End

I was hoping to be able to invert the wave and be able to keep the original wave. I tried making a copy of the wave, but once I invert one, the copy also inverts. Please let me know if there is a way to do this.
Thank you!
hbridgewater wrote:
I was hoping to be able to invert the wave and be able to keep the original wave. I tried making a copy of the wave, but once I invert one, the copy also inverts.


No, that's not the way Igor works. At least, not unless you try really hard to make it work that way.

Post all of the code where the duplicate also inverts. I'm skeptical.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
I'm sorry I incorrectly explained my problem. I can invert the duplicate so that I have the original and the inverted wave, but then when I try to use the Peak Areas.ipf Macros on the inverted wave, I cannot get the Auto Identify and Measure Peaks for both the inverted and original wave.