Subscribe Bookmark RSS Feed

using choose function to run different scripts

h_lazar

Community Trekker

Joined:

Jun 23, 2011

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" ),

      )

);

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

You 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,

.

.

.

2 REPLIES
Solution

You 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,

.

.

.

h_lazar

Community Trekker

Joined:

Jun 23, 2011

That was it. Thanks for answering my simple and inexperienced question.

H