How do I determine the target graph from inside a function without argument
schollz
For example, "ShowInfo", without "/W" specified, operates on the target graph (last opened graph) since a named graph was not specified.
How does a function, like ShowInfo, know which graph to operate on, the "target graph"? Is there a global variable that stores the graph name of the last focused graph?
Thanks!
Sincerely,
Zack
kwTopWin
as an alias to the top window is what you have in mind?showinfo/w=kwTopWin
. I am not sure if this will work.best,
_sk
April 27, 2017 at 01:20 am - Permalink
However, this might get funny results if the user is impatient and focuses another window while that function is running. Here you would really need the name of the initially active window and pass this name to the function.
HJ
April 27, 2017 at 01:50 am - Permalink
if (strlen(gname) == 0)
gname = WinName(0,1)
endif
ModifyGraph/W=$gname ...
end
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
April 27, 2017 at 08:59 am - Permalink
WinName(0,1)
works great!April 27, 2017 at 09:56 am - Permalink