Hi JMP Community,
I'm building a JMP add-in that creates windows, stores global variables, and calls functions. Everything works fine with a single instance — but when the user launches the add-in twice, the two instances share the same global scope and variables start conflicting (one window overwrites the other's state).
I initalized my script with Names default to here(1), I have even created my own new space (ns = newspace() ) and put every variables in it but I still do have the conflict. I know about window namespace but I want also to avoid conflict on the variables outside the window
// Launch this script twice — second run breaks the first window
strLabel = "Instance A";
counter = 0;
win = New Window( "Test " || strLabel,
btn = Button Box( "Click me",
counter++;
btn << Set button name( strLabel || " clicked " || Char( counter ) || "x" );
)
);