"Cant use $ in this way in a function"

What am I doing wrong here?

make W_sigma
make datawaveCropped
string bloach = "W_sigma"
datawaveCropped=$bloach
Try this:
make W_sigma
make datawaveCropped
string bloach = "W_sigma"
wave wbloach=$bloach
datawaveCropped=wbloach

Hope this helps,
Kurt
These Igor commands will display help topics that discuss the issues involved here:

DisplayHelpTopic "Accessing Global Variables And Waves"
DisplayHelpTopic "Accessing Waves In Functions"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
That's right. Or when looking up a pre-existing wave at a time when it will exist.

To be more precise, though, you can use Wave/Z where the /Z means "look up a wave but it's OK for it to not exist". Then use WaveExists() function to find out if the wave reference variable actually refers to a wave.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com