I accidentally generated a few hundred tables because of a wrong-placed command in a loop and wanted to kill these tables using Killwindow command. However I wasn't able to reference the window by string returned from winlist or winname. What declaration should I use ahead of these strings to be able to reference the window or tables that I wanted to close, or how will Killwindows recognize windows that need to be killed? Thank you!
Thank you Andy!
my code is as follows but I cannot seem to pass the string to killwindow...It seems that I need to specify that "windowname" refers to a window to kill so that Igor knows..,
function killwindows()
string list = winlist("*", ";", "WIN:2") variablei
my code is as follows but I cannot seem to pass the string to killwindow...It seems that I need to specify that "windowname" refers to a window to kill so that Igor knows..
KillWindow takes a window name, not a string containing a window name.
Use $ like this:
function killwindows()
string list = winlist("*", ";", "WIN:2") variablei
Create a loop and go through the winlist.
Andy
April 15, 2017 at 03:25 pm - Permalink
my code is as follows but I cannot seem to pass the string to killwindow...It seems that I need to specify that "windowname" refers to a window to kill so that Igor knows..,
string list = winlist("*", ";", "WIN:2")
variable i
for (i=0;i<itemsinlist(list); i+=1)
string windowname = stringfromlist (i,list, ";")
killwindow windowname
endfor
end
Thanks!
April 16, 2017 at 12:51 pm - Permalink
KillWindow takes a window name, not a string containing a window name.
Use $ like this:
string list = winlist("*", ";", "WIN:2")
variable i
for (i=0;i<itemsinlist(list); i+=1)
string windowname = stringfromlist (i,list, ";")
killwindow $windowname
endfor
end
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
April 16, 2017 at 01:06 pm - Permalink
April 16, 2017 at 09:32 pm - Permalink