reference wave name with number

Hi,

Can I reference a wave whose name starts with a number using the $string way?
If my wavename is 2000_methane, will Igor recognize $'2000_methane', or $"'2000_methane'"?
I guess in this case, (as when wave name begins with number), an underscore line doesn't make a difference between '2000_methane' and '2000 methane'?
Thank you!
if the wave name is 2000_methane, then using $ would be $"2000_methane" or if a string variable s contains 2000_methane, then $s.

The underscore is part of the name.

The single quotes are needed only when a command or expression needs to be parsed and are not part of the name.

Larry Hutchinson
WaveMetrics
support@WaveMetrics.com
Thank you Larry! I am not sure I fully understand 'The single quotes are needed only when a command or expression needs to be parsed and are not part of the name', could you give me an example? Thank you again!
If the string contains a path to a wave, like "root:mydf:'2000_methane'" it has to be parsed to separate the elements of the path. If the name appears as a literal part of a command line, like
Duplicate '2000_methane', newwave

then it has to be parsed to separate the wave name from the rest of the command. If a simple (i.e., not a path) name is stored in a string:
String thename = "2000_methane"
Duplicate $thename, newwave

then the name doesn't have to be parsed because it is inside an object (the string) that object will be passed along whole to whatever needs the wave name.

Perfectly clear, right?

Basic rule here: a simple name contained in a string variable doesn't need to be parsed, and should not have the single quotes.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Yes, I understand it now, thank you very much for the explanation Johnweeks! Thank you!