Subscribe Bookmark RSS Feed

Is there a way to enforce sequential execution of commands in a script?

charliem

Community Trekker

Joined:

Apr 4, 2014

If I run this command:

x = 1.5;

minimize( (t distribution(x, pooled_df[i])-0.95)^2, {x},<< Tolerance(0.0005) ) ;

print(x);

It bombs on the print command (or any other command that relies upon x).

Now, if I put a wait(5) in there it's OK.

But I would much prefer to jsut have the thing execute sequentially (in the sense that instruction n+1 doesn't begin until instruction n is done).

Is there a way to make JSL do this?

Thanks,

Charlie

4 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Put wait(0) to "flush" JMP's queue.  I do this all the time to force sequential execution.

charliem

Community Trekker

Joined:

Apr 4, 2014

Do I put the wait(0) before or after the minimize( .... ) function? I couldn't find anything in the scripting guide about this... is it in some other documentation?

Thanks,

Charlie

pmroz

Super User

Joined:

Jun 23, 2011

Put wait(0) after the minimize command.  I can't remember how I learned about this trick.  Folklore maybe?

Phil_Brown

Super User

Joined:

Mar 20, 2012

It would be interesting to know if the following does what you want:

EvalList(

{

x = 1.5,

minimize( (t distribution(x, pooled_df[i])-0.95)^2, {x},<< Tolerance(0.0005) ),

print(x)

}


);

PDB