cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

fix the bug in Substitute

☐ cool new feature
☐ could help many users!

☐ removes a „bug“

☑ nice to have

☐ nobody needs it

 

There is a bug in Substitute if several items are substituted simultaneously or sequentially in a JSL code.

JMP complains that the code is not correct.

The code works after feeding it through  parse(char(my code)). And it works as well if the file is saved and re-opened:

https://community.jmp.com/t5/Discussions/Col-Median-what-s-wrong/m-p/573778#M78278

really strange.

 

 

 

 

7 Comments
hogi
Level XI
SamGardner
Staff
Status changed to: Acknowledged

@hogi I don't understand what the issue is that you are describing.  A more complete description would be appreciated. 

 

Also, in general, for issues that are potential bugs in JMP, the best route is to send that to our technical support team (support@jmp.com) so that they can investigate it.  If it turns out that the issue needs to be addressed by adding a new feature to JMP, then a post to the wish list is appropriate.  

SamGardner
Staff
Status changed to: Needs Info
 
SamGardner
Staff
Status changed to: Not Planned For Now

Given that there is a solution, will move this off our wishlist active items.  

SamGardner
Staff

@julian provided the script below that illustrates the problem.  We will investigate this bug.

 



//control condition
expression1 = Expr(  Sine( Log( Round ( 2.5 , 0 ) ) )   );
Eval( expression1 );
Show( NameExpr(expression1));

//Succeeds, using additional parentheses to help JMP know these are functions
expression2 = Expr(  __func1__(__func2__( __func3__( 2.5 , 0 ) ) )   );
Substitute Into( expression2,
	Expr(__func1__),Expr(Sine()),
	Expr(__func2__),Expr(Log()),
	Expr(__func3__),Expr(Round()),					
);
Show( NameExpr(expression2));
Eval( expression2 );


//Also Succeeds, becuase only 1 function doesn't have ()
expression3 = Expr(  __func1__(__func2__( __func3__( 2.5 , 0 ) ) )   );
Substitute Into( expression3,
	Expr(__func1__),Expr(Sine),
	Expr(__func2__),Expr(Log()),
	Expr(__func3__),Expr(Round()),					
);
Show( NameExpr(expression3));
Eval( expression3 );


//Fails, even though expression looks correct from show
expression4 = Expr(  __func1__(__func2__( __func3__( 2.5 , 0 ) ) )   );
Substitute Into( expression4,
	Expr(__func1__),Expr(Sine),
	Expr(__func2__),Expr(Log),
	Expr(__func3__),Expr(Round),					
);
Show( NameExpr(expression4));
Eval( expression4 );
hogi
Level XI

Yes, seems that as soon as TWO or more functions in the substitution are given without brackets, the expression cannot be evaluated anymore.

The error message also pops up if the substitutions are applied one after the other, like in https://community.jmp.com/t5/Discussions/Col-Median-what-s-wrong/m-p/573778#M78278 

 

On the other hand: cool that JMP can substitute functions.

In addition: nice workaround to  "write all functions with brackets"

SamGardner
Staff
Status changed to: Investigating