Hello everyone,
I have a question regarding JMP-Classes. I'm using custom classes to create instances as an interface for custom (sql) requests. These classes contain among other things a namespace, a window and a button. It works pretty good - however I have some generall/global classes which i also want to execute within these instances.
Dummy sample for a global class:
New Namespace("BASICS",
{
BASIC_FUNCTION = Function({A, B},
C = A * B;
Print(C);
Return(C);
);
}
);
And this is my handle function for the submit button. THIS_WN
is the class containing the window and the button.
NS
is the namespace within this class.
HANDLE_SUBMIT = Function({THIS_WN},
THIS_WN:GET_WINDOW << Show Window(0);
THIS_WN:NS:A = 2;
THIS_WN:NS:B = 3;
THIS_WN:NS:CMD = JSL Quote(
Local Here(
Include(Get Path Variable("ADDIN_HOME(~ my AddIn ~)") || "LIB\BASICS.jsl");
Namespace("$NS$"):RESULT = BASICS:BASIC_FUNCTION(Namespace("$NS$"):A, Namespace("$NS$"):B);
Print(Namespace("$NS$"):RESULT);
Namespace("$NS$"):RESULT = Namespace("$NS$"):RESULT + 1;
Print(Namespace("$NS$"):RESULT);
Window("$WN$") << Show Window(1);
);
);
THIS_WN:NS:CMD = Substitute(THIS_WN:NS:CMD, "$NS$", THIS_WN:NS << Get Name);
THIS_WN:NS:CMD = Substitute(THIS_WN:NS:CMD, "$WN$", THIS_WN:GET_WINDOW << Get Window Title);
Eval(Parse(THIS_WN:NS:CMD));
Print("HERE");
//CASES
//X = 1;
//Print(THIS_WN:NS:CMD);
);
I can execute the command and get the sql/datatable result. I also have controll over the window within the local here section. However after evaluation the command I really can't do anything else. Starting from "//CASES" all examples are not working, saying that there is no defined variable within this class.
Is there a way to "come back to the class" after a "local here" section?
Thank you in advance !