To define a custom function, use New Custom Function(). After a function is defined, you can add or activate it in the current running instance of JMP using Add Custom Functions() . Similarly, you can remove or deactivate a function using Remove Custom Functions().
New Custom Function() requires three parameters: namespace, functionName, functionDefinition. Additional messages may be passed to define the following:
funcDef = Function( {x, y = 10}, x + y );
description = "This function adds 2 values. If only 1 argument is specified, the 2nd argument defaults to 10.";
ex2 = Expr(
parmHint1 = "x value";
parmHint2 = "<y=10>";
newAdd << Description( description );
newAdd << Example( Name Expr( ex2 ) );
Add Custom Functions( newAdd );
The Formula Category message results in a new category in the Formula Editor’s list of formula categories. Custom functions are shown with an underline in the Formula Editor. Also see the hint text from the Parameter messages.
To delete a custom function, use Remove Custom Functions( {"name"} ).
Remove Custom Functions( {"myNamespace:Add Ten"} );