When prompting for input in a dialog, here are two common ways to do things:
1. Use a modal dialog to pause the execution of the script while waiting for input:
Names Default To Here( 1 );
dt=Open("$SAMPLE_DATA/Big Class.jmp");
// Prompt for the input
rc = New Window("Choose the parameters to be plotted",
<<Modal, <<Return Result,
rb = Radio Box({"weight", "height"})
);
// Launch report if Ok was pressed
if (rc["Button"] == 1,
// Ok pressed
Choose (rc["rb"],
Graph Builder(Variables(X(:age), Y(:weight))),
Graph Builder(Variables(X(:age), Y(:height)))
);
,
// Cancel
"Cancel"
)
In your script, variable "cb1" is a DisplayBox. In this example, the <<Return Result option turns all of the display box information into result data. In a modal dialog the boxes are deleted before execution continues, so this is important!
2. Do the "action" part of the dialog as part of a button script:
Names Default To Here( 1 );
dt=Open("$SAMPLE_DATA/Big Class.jmp");
// Prompt for the input and create graph
rc = New Window("Choose the parameters to be plotted",
rb = Radio Box({"weight", "height"}),
Button Box("Ok",
Choose(rb<<Get,
Graph Builder(Variables(X(:age), Y(:weight))),
Graph Builder(Variables(X(:age), Y(:height)))
);
rb<<Close Window;
)
);
A modal dialog will block all other input to other windows, while the second approach would allow you to continue using other windows in JMP at the same time.
Hope that helps!