using choose function to run different scripts<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I am not sure this is possible, it does not seem to be working. I have written three different scripts to manipulate a data table and then journal a bunch of plots. The scripts are quite involved but fairly similar. However, I have them written in separate files. Then I wrote another script to create a new window with a radio box option to choose which script to run. I am using the choose conditional function to run the appropriate script. However, nothing seems to be happening. Are there any ideas where I may be going wrong? Is this a namespace thing because I have stayed away from this complicated subject?
thanks in advance
H
Clear Symbols();
//dialog for fitting options
dlg = New Window( "Fit By ...",
V List Box(
Panel Box( " choose an option: ",
rad1 = Radio Box( {"option1", "option2", "option3"} )
),
Text Box( " " ),
H List Box(
bok = Button Box( "ok",
fit = rad1 << get;
dlg << close window;
),
Text Box( " " ),
bcancel = Button Box( "cancel", dlg << close window )
),
Text Box( " " )
)
);
If( !Is Missing( fit ),
Choose( fit,
//option 1
Include( "script1.jsl" ),
//option 2
Include( "script2.jsl" ),
//option 3
Include( "script3.jsl" ),
)
);
Re: using choose function to run different scriptsWow Jthi! You hit the nail on the head here. Thank you so much. Works like a charm. I appreciate it.
Re: using choose function to run different scriptsThis is fairly old topic so syntax might have gone through some changes. Here is an example which should give you an idea how to develop your script:
Names Default To Here(1);
rb_selections = {"timeAnnouncer", "triangleProbability", "JMPStarter"};
scriptFolder = "C:\Program Files\SAS\JMP\15\Samples\Scripts\";
If(
nw = New Window("Dialog() example",
<<MODAL></MODAL>Also see Scripting Index directly from JMP and JMP15 Scripting Guide
Re: using choose function to run different scriptsNote that these are longer scripts (500-1000 lines each) and I would like to open them if selected by the radiobox after OK is clicked.Re: using choose function to run different scriptsHello! I am using this script as a basis for my own. I can get my prompt window to pop up and both the OK and CANCEL buttons seem to work but the last portion here:
If( !Is Missing ( scriptselection ),
Choose (scriptselection,
//Run Rg Script
Include("Rg Script.jsl"),
//Run Camtek Script
Include("Camtek.jsl"),
//Run Probe 1/3 Script
Include("Probe 1/3.jsl")
)
);Can you speak a bit more on this? I would like to open and immediately run these files from a location in my computer. Is this the correct approach? Or do I need to specify location more? (If so how do I do this?) Thank you!
Re: using choose function to run different scriptsThat was it. Thanks for answering my simple and inexperienced question.
H
Re: using choose function to run different scriptsYou have a modeless dialog box, which will happily execute all commands after the new window() command while you are looking at the dialog box.
Try using a modal dialog box instead:
dlg = New Window( "Fit By ...", << modal,
.
.
.