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")variableifor(i=0;i<itemsinlist(list); i+=1)string windowname = stringfromlist(i,list, ";")killwindow windowname
endforend
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")variableifor(i=0;i<itemsinlist(list); i+=1)string windowname = stringfromlist(i,list, ";")killwindow$windownameendforend
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..,
Thanks!
April 16, 2017 at 12:51 pm - Permalink
KillWindow takes a window name, not a string containing a window name.
Use $ like this:
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
April 16, 2017 at 01:06 pm - Permalink
April 16, 2017 at 09:32 pm - Permalink