cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

Custom Function - add comment

Some of the examples in the Scripting Index have lots of details and useful comments:

hogi_0-1737185109806.png

 

When a user submits a function via Add custom Function(), such comments are automatically removed:

hogi_1-1737185298165.png

 

What do I have to do to see the comments?

Add Custom Functions(
	New Custom Function(
		"test",
		"f",
		Function( {}, Print( "hello world" )
		),
		<<Description( "test function" ),
		<<Example(
			Expr(
			x=3;
		// here I want to add a comment which will be displayed in the scripting index
				f()
			)
		)
	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Custom Function - add comment

Usually JSL Quote() can help with these type of situations. Additional benefit is that you don't have to use strings when building your functions

 

Names Default To Here(1);
myAdd = New Custom Function(
	"custom",
	"Add",
	Function({x, y = 1},
		x + y - 1
	)
);
myAdd << Example(JSL Quote(// add first to second
	a = Add(1, 2);
	Show(a); // a = 3;
));

Add Custom Functions(myAdd);

jthi_0-1737187104740.png

 

 

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Custom Function - add comment

Usually JSL Quote() can help with these type of situations. Additional benefit is that you don't have to use strings when building your functions

 

Names Default To Here(1);
myAdd = New Custom Function(
	"custom",
	"Add",
	Function({x, y = 1},
		x + y - 1
	)
);
myAdd << Example(JSL Quote(// add first to second
	a = Add(1, 2);
	Show(a); // a = 3;
));

Add Custom Functions(myAdd);

jthi_0-1737187104740.png

 

 

 

-Jarmo

Recommended Articles