very disturbing behavior in compiler
jtaylor
Please see my attached file, and try compiling it on your machine.
Yes, there should be an error in the second call to 'Duplicate'.
However, no error is generated. I have observed this on two different computers.
Does anyone else see this error?
Thanks,
Jeff
Use <igor> and </igor> tags around the text to show Igor code in-line:
Function TestCompile(ctrlName) : ButtonControl
String ctrlName
Make/O junk
Variable j=7 // show what happens when you run this code
if (j==7)
String JunkStr="HeresJunk_"
String JunkStr2="HeresJunk2_"
Duplicate/O junk $JunkStr
Duplicate/O $JunkStr2 // SHOULD NOT COMPILE ?
endif
End
It is true that the compiler accepts only one arg to Duplicate when two are needed.
Running the code does give a run-time error "expected wave name" on that line.
The compiler author could explain why, but I suspect it is because of the complexities of using $stringExpression.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 24, 2015 at 04:27 pm - Permalink
September 24, 2015 at 04:31 pm - Permalink
would also not give an error until runtime.
Duplicate was not checking for zero destinations. Now it does. The next (tomorrow's) nightly build will have this change. You can get the nightly build here:
http://www.wavemetrics.net/Downloads/latest/
Larry Hutchinson
WaveMetrics
support@WaveMetrics.com
September 25, 2015 at 08:29 am - Permalink
September 28, 2015 at 12:27 pm - Permalink