BookmarkSubscribeSubscribe to RSS Feed

Re: More help with Modal 2

Mickyboy

Contributor

Joined:

Jun 17, 2018

Hi all,

 

Just need a little more help and i think I'm done, is anyone able to identify why whis code wont run???

Names Default To Here ( 1 );
Clear Symbols ();

pb = Page Break Box(); 


fileopen= "\\\desktop\Kate\TIV\JMP Data.jmp";

var_name = New Window ("Variable Analysis", << Modal, << Return Result,
			Text Box ("Please enter Variable to analyse"),//Create the display box
			HListBox(
				LineupBox (NCol (2), 
					Text Box ("Enter Variable Name"), nameVar = textEditBox(" FBV TIV (%w/v)"),
					), // end of lineupbox
				LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
			) // end HlistBox
);

show (var_name, var_name ["nameVar"] );

If (var_name ["Button"] == -1,
	Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (var_name, NItems(var_name)); // Removes the last item "Button 1" from the assignment list
Eval List(var_name); // the assignment from the display box are run
Show ( var_name, nameVar );

Eval(
	Substitute(
			Expr(
					Process Capability(
					Process Variables( Column (As Column (nameVar)) ) ),
					Spec Limits(
					Name( "" )(LSL( 0.008 ), Target( . ),
					USL( 0.012 ))
					),
					Spec Limits Dialog( "Yes" ),
					Individual Detail Reports( 1 ),
					Capability Box Plots( 1 ),
					Goal Plot( 1 ),
					Capability Index Plot( 1 ),
					SendToReport(
					Dispatch(
					{__myvar__},
					"1",
					ScaleBox,
					{Label Row( Label Orientation( "Perpendicular" ) )}
					)
				)
			),
			Expr( __myvar__ ), nameVar
		)
	)
);

Thanks All

 

3 REPLIES
Highlighted
txnelson

Super User

Joined:

Jun 22, 2012

when you run the code, it gets an error.mickey1.PNG

It is clearly telling you that you have a miss match in ")"s.

What I do then, is attempt to isolate where the error is.  So I start by just running diffrent sections of the code to see if it parses correctly.  So with your code, I selected everything before the "Eval(Substitute(Expr" and then selected "Reformat Script".  When it reformats it, it also parses the code for correctness.

Mickey2.PNG

The first section Reformats without an issue, so you know that code is syntactically OK.

So then I moved on to the "Eval(Substitute(Expr(" piece of code

Mickey3.PNG

An error was found

Mickey35.PNG

So now you know the general area of the error.  Using the ")" highlighting of pairs ability in the JSL editor, you can find which pairs of ")"s JMP determines are going together

Mickey4.PNG

Here you can see that the "(" following the "Eval" is matched not with the last ")", but with the second to last ")".  That means that either there is an extra closing ")", and you should delete the last ")", or that you have an extra one in code above.  So now what you need to do, is to start working through the small parts of this code, where you know what the beginning and ending sections are, and see where an issue is.  

 

Jim
Mickyboy

Contributor

Joined:

Jun 17, 2018

Hi txnelson,

 

thanks very much for that, extremely handy to know, but even when i take the extra ")" out, the code wont run, but i dont get an error code

txnelson

Super User

Joined:

Jun 22, 2012

Removing the one additional ")" is not the only error.  As I stated in my last response

 

"So now what you need to do, is to start working through the small parts of this code, where you know what the beginning and ending sections are, and see where an issue is. "

Jim