Stuck on ModalHello All,
i was hoping that someone can help me with Modal, previously i was calculating FV in my JMP script as follows:
Finalivc2 << New Column( "Runs", Numeric, Continuous );
:Runs<<SET each="" value=""></SET>
which worked OK, although on ocassions i would forget to update the :Runs and :Replicates per run parameters which gave me some grief, i decided to automate this process using modal as follows
FV_param = New Window ("Format Variability Parameters", << Modal, << Return Result,
Text Box ("Select Format Variability Parameters"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Runs NOT REPLICATES"), Runs = numberEditBox(2),
Text Box ("Replicates NOT RUNS"), Replicates per Run = numberEditBox(1),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HListBox
);
show (FV_param, FV_param ["Runs"], FV_param ["Replicates per Run"],
FV_param ["Button"] );
If (FV_param ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (FV_param, NItems(FV_param)); // Removes the last item "Button 1" from the assignment list
Eval List(FV_param); // the assignment from the display box
Eval(
Substitute(
Expr( Finalivc2 = New Column( "Runs", Numeric, "Continuous", Format( "Best", 12 ),
Expr( Finalivc2 = New Column( "Replicates per Run", Numeric, "Continuous", Format( "Best", 12 ),
)
),
Expr( __FV_param__ ), Runs, Replicates per Run
)
)));
Finalivc2 << New Column( "Format Variability %GCV", Numeric, Continuous, Formula( ((2^root(((:IR)/(:Runs)+(:Residual)/(:Replicates per Run*:Runs)),2))-1)*100 ), Format( "fixed dec", 4, 1 ) );i have no doubt i am doing the evaluating and substituting incorrectly, i am not getting the variables runs and Relicates per run in the table, and its then not doing the calculation, can anyone please offer some help
Thanks
Re: Stuck on ModalHi pmroz,
Thanks very much for your reply, i accepted Craige post from yesteday as the solution, i had miss coded from yesterday.
Regards,
Mickyboy.
Re: Stuck on ModalHi Graige,
Your solution from yesterday was correct, i miss coded, i used
dt<< new column instead of finalivc2<
| Runs | Replicates per Run | Format Variability %GCV |
| 2 | 1 | 26.1 |
| 2 | 1 | 25.9 |
| 2 | 1 | 29 |
| 2 | 1 | 28.4 |
| 2 | 1 | 29 |
| 2 | 1 | 29.6 |
| 2 | 1 | 28.4 |
| 2 | 1 | 28.4 |
| 2 | 1 | 20.7 |
My sincere apologies, it works great, thanks very much for your patience and help, it is greatly appreciated.
Sincere Regards
Mickyboy
Re: Stuck on ModalI'm not sure where the journal is coming from or why it would say that. I run your code, with a dt open, and I get this:
columns added with values setcolumns added with values set
I think @pmroz answer is not returning the values through the <
Is your table being created with the columns and values now? Maybe there is another issue after that.
Re: Stuck on ModalYou are trying to use the number edit box variables as values that were entered. You can't do that; instead you need to extract the values from the number edit boxes using << get. In the code below I've appended _neb to the variables:
FV_param = New Window( "Format Variability Parameters",
<<MODAL></MODAL>
Re: Stuck on ModalHi Craige,
l am running the same version 14, so now my code looks like this
FV_param = New Window ("Format Variability Parameters", << Modal, << Return Result,
Text Box ("Select Format Variability Parameters"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Runs NOT REPLICATES"), Runs = numberEditBox(2),
Text Box ("Replicates NOT RUNS"), Replicates per Run = numberEditBox(1),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HListBox
);
show (FV_param, FV_param ["Runs"], FV_param ["Replicates per Run"],
FV_param ["Button"] );
If (FV_param ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (FV_param, NItems(FV_param)); // Removes the last item "Button 1" from the assignment list
Eval List(FV_param); // the assignment from the display box
dt<<NEW column=""></NEW>but it still wont set the valuse to what was input into the modal boxes, i get this in the Journal:
Format Variability %GCV
.
.
.
.
.
.
.
.
.
No values are posted in the Journals.
Any ideas??
Thanks for your help
Re: Stuck on Modal(What version of JMP are you running? I'm on 14...)
You don't need to use substitute(...). Try replacing your eval( ... substitute(... (expr(... code with something like
dt<<NEW column=""></NEW>
In your example, the parenthesis nesting has left substitute(eval(...)) with a single argument to substitute. Substitute needs (edit two->three) three arguments.
Re: Stuck on ModalHi Craige,
Had some time so tried to run the script with your suggestion, still didnt run, get the same error in debug, not enough arguments in access of evaluation of sustitute.
Regards
Mickyboy
Re: Stuck on ModalHi Craige,
have run out of time today but will try this in the morning and let you know, the problem i was having was evalusting and substituting the values from the dialogue boxes to the equation.
thanks
Re: Stuck on Modalthe last bit of your script should look something like this. You may also run into some naming issues with JSL variable names and column names that are the same; using dt:Runs or global:Runs may help get the right one.
dt=currentDataTable(); // you should already have a variable for your data table
dt<<NEW column=""></NEW>