NOTE PROBLEMS

I cannot seem to get this snippet of code to run in my procedure, but it works fine if typed directly into the command window

// F_selected is a string containing the name of a wave, new_note is a string.

function write_note()
SVar F_selected = F_selected
SVAR new_note = new_note

Note /K $F_selected new_note

end

Not sure if it is a bug, or a formatting problem. Is there a way to execute commands in a procedure as if they were typed into the command window?
BE23 wrote:
I cannot seem to get this snippet of code to run in my procedure, but it works fine if typed directly into the command window

// F_selected is a string containing the name of a wave, new_note is a string.

function write_note()
SVar F_selected = F_selected
SVAR new_note = new_note

Note /K $F_selected new_note

end

Not sure if it is a bug, or a formatting problem.

Have you tried setting a breakpoint on the Note command to make sure F_selected really has the correct name as its contents? I did this:
make junk
killvariables F_selected
string F_selected="junk"
String new_note = "new note"
write_note()

and it worked correctly.

Quote:
Is there a way to execute commands in a procedure as if they were typed into the command window?

No, but you can use Igor's symbolic debugger to investigate the internals of a running function:
DisplayHelpTopic "The Debugger"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com