Posts: 40,483
Threads: 491
Joined: Aug 2002
Any root level template actions would likely need to be of that non-UI accessing type, since there's no way to provide a context create the commands anyway.
Dean Roddey
Explorans limites defectum
Posts: 273
Threads: 38
Joined: Jan 2009
Dean Roddey Wrote:The simplest thing might be just allow for some at the root template that everyone can call througha RunRootTmplAction() command, and otherwise it has to be with the immediate parent. Most folks do end up witha single root template that everything else exists with the context of.
Dean Roddey Wrote:Any root level template actions would likely need to be of that non-UI accessing type, since there's no way to provide a context create the commands anyway.
Dean,
Your suggestion is very reasonable and provide an acceptable solution to the challenge. These kind of actions don't need to provide a UI access type, the address the need for all the rest (logic, device driver, .....system,GVars). The truth is that If/Else and device driver are by far more important.
Your solution provides a nice
encapsulation (we invoke the action not knowing how it being done), you offer
re-usability of code and the only question I have is:
how soon can you implement it :-)
Am I too pushy? Well, I promise to be the beta tester of your new RunRootTmplAction( action )!!
Please...,
Rocker
Posts: 3,415
Threads: 158
Joined: Jan 2006
It would be nice if these global functions were accessible from the event system (scheduled/triggered events) as well.
A "hack" that I use all the time is to create a new template and place the "macro" code in the onload for the template. These would be actions that I want to be able to run from anyplace in IV. The last command in onload needs to be to exit interface viewer. I invoke the template as a pop-up anywhere I want to run the commands. The pop-up runs the onload commands and then closes itself since the last command is to exit. Voilà! I now have commands that can be run from anywhere in IV. I also have the additional feature of being able to add some friendly text on the template to let the user know what is happening and to please wait. I also add a "close" button on the template just in case there is an error so that the user can close the template.
Posts: 273
Threads: 38
Joined: Jan 2009
Dean,
Any plans to address the issue? We can use Vida's idea but I'm not sure you would like us to go this way.
Thanks,
Posts: 40,483
Threads: 491
Joined: Aug 2002
Nothing is going to happen for this release. It's way too close to be doing anything like that. We can look at it after 3.0 goes out.
Dean Roddey
Explorans limites defectum