Do you know why my script fully runs when I run it manually but it does not work when I run it from a command in the toolbar?Hi Guys,
I have this script that works 100% when I run it manually.
When I run it from the toolbar(automatically) it does not run the last section.
Do you have an idea of why this is happening?
I added a comment in the script in the point is not working anymore:
//STARTING FROM HERE THE SCRIPT DOES NOT RUN IN TOOLBAR MODE
//Script for GRR Anlaysis for Qual Data
names = {};
//prueba={};
RepeatabilityData = {};
ReproducibilityData = {};
GaugeRRData = {};
ParttoPartData = {};
NDCData = {};
Datos_table = Current Data Table();
For( i = 1, i <= N Col(), i++,
Insert Into( names, Column Name( i ) )
);
dlg1 = Dialog(
Title( "GR&R" ),
"Select Tests",
vlist( selectiontests = List Box( names ) ),
"Select Channel Column",
vlist( selectionchannel = List Box( names ) ),
"Select Category (Pre/Post) Column",
vlist( selectioncategory = List Box( names ) ),
"select Devices Number Column",
vlist( selectionSN = List Box( names ) ),
synch = Check Box( "Generate Journal", 0 ),
hlist( button( "OK" ), button( "Cancel" ) )
)
;
if (dlg1["Button"]==1,
column(dlg1["selectionchannel"])<<SET modeling="" type="">0.4,
ListDelta[l]<<SET property=""></SET></SET>Automation and ScriptingRe: Do you know why my script fully runs when I run it manually but it does not work when I run it from a command in the toolbar?Hi @CrownofTears ,
when i had these issues in the past i found out that adding Wait (0.1) before the loop and at the end of each loop made it work. in your case i a do not have an obvious suspect for the slow behaviour. i would just put a Wait (0.1) after each ; in the last loop and see if it works
this solves the issue that sometimes jmp moves on the the next step without making sure the previous has ended.
Re: Do you know why my script fully runs when I run it manually but it does not work when I run it from a command in the toolbar?@CrownofTears -- way too late, I suppose, but try adding
TabData << RunFormulas;
in place of the comment. JMP's column formulas run when JMP is idle, so running it a section at a time will allow the formulas to evaluate. Adding wait statements might let the formulas have enough idle time to complete, but it is impossible to pick the perfect wait time. <
Col Std Dev(As Column(ListDelta[l]))
is not figuring it out.
Re: Do you know why my script fully runs when I run it manually but it does not work when I run it from a command in the toolbar?Hi @Craige_Hales, we shoud exactly add the
TabData << RunFormulas;
After this comment?
//STARTING FROM HERE THE SCRIPT DOES NOT RUN IN TOOLBAR MODE
if yes, already did and did not work 
Re: Do you know why my script fully runs when I run it manually but it does not work when I run it from a command in the toolbar?(Yes, that was what I meant.)
I'm guessing.
Are you getting messages in the log window when it fails? You might add print() statements to isolate the failure.
My next guess is the current data table() isn't doing what you expect. Try using explicit data table scoping instead of depending on CurrentDataTable.
Depending on the CurrentDataTable is a fragile way to build code because
- it can change when another table becomes current (which seems likely with a new window opening)
- it can be different in different contexts (which seems likely with a toolbar context in play)
Another thing to try: uncheck the "use here namespace" in the toolbar to see if it works. That will tell us something too.