I created an "Update" button and when the button is clicked, "updateDeciles" script will run (see below). First, a dialog box will open, if the "Cancel" button is click, exit script; if the "OK" button, check the inputs and then continue the rest script. My script for "Cancel" doesn't work. I searched Script Guide and didn't find anwser. Any help will be appreciated.
1. Throughout JMP when you want to say "if X is somevalue then ..." you need to use a double equal sign: if (X == somevalue, some code, some other code) 2. Before worrying about making your update button work you need to make sure you can make the dialog work. 3. Though it is tempting to think that you can get access to the values entered into the dialog by referencing variable1 and variable2 directly that's not how the dialog works. You need to write: dlg = Dialog( your dialog stuff as written ); Then dlg contains a List. Do a show(dlg) to see what it looks like. To access the values you are looking for you write things like: if(dlg["Button"]==-1, throw("Cancelled"); and a = dlg["variable1"]; if(ismissing(a),throw("input submission weights"))
Note that you need to use ismissing(a) to find out if a is missing.
For basics on Lists, start at p103 in the scripting docs (help>books>JMP scripting guide) and particularly look at p105, the section on subscripts. For an example of accessing values from a (relatively) simple dialog look at p273-274 under "Details common to Dialog and Column Dialog"