I am writing an add-in to operate on the Current Data Table(). I want the add-in to exit gracefully without doing anything if:
(a) there is no Current Data Table()
or
(b) the Current Data Table has <2 columns.
I can't seem to get this to happen. I installed the add-in and looked at the .jmpcust file that was generated. Up at the very top of the script where the comment says "Variables and functions declared here are scoped to the Application namespace", I note this code:
dt = Current Data Table();
If(Is Empty(dt),
Quit Application()
);
Quit Application = Function({},
Current Window() << Close Window;
Throw()
)which I *think* was inserted by Application Builder (and not by me).
It would seem to be right for accomplishing (a), but instead my add-in charges ahead in the absence of a Current Data Table() and opens its dialog window.
Can someone help me out?