Hello,
I'm trying to prompt users to make a selection of groups from a window that opens at the start of a script that defines an object to be used for the remainder of the script. When the user selects and uses the button box, it works great, but if they close with the window, JMP slows down and it becomes impossible to edit the script window without right clicking>Stop Script. Does anyone have any ideas on what is missing here?
Names Default to Here (1);
groupsel=Expr(
done = 0;//Track if selection made
nwcurr = New Window("Select Group",
V List Box(
Text Box("Please select a group:"),
rb = Radio Box({"A", "B", "C"}),
Button Box("OK",
// Set the selected currency based on the user's choice
group = rb << Get Selected;
nwcurr << Close Window; // Close the modal window after selection
done = 1; // Mark the selection as done
)
)
);
nwcurr << On Close(
Throw("No selection made. Script stopped."),Stop();
);
// Wait loop until the selection is made
Wait(0.1); // Small wait to reduce CPU usage
while(done == 0, Wait(0.1)); // Loop until 'done' is set to 1
);
Eval(groupsel);