cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
FN
FN
Level VI

Calling functions that are part of an application add-in

How can I call functions that are created in an application add-in? 

 

For example, having the add-in ID "my_addin", I expect something like this.

 

Script in the add-in.

foo = Function({x}, Return(x^2));

 

A script in a data table.

Try(
    y = my_addin.foo(3);,
    Throw("'my_addin' is not installed");
    );

print(y); #9

# 9

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Calling functions that are part of an application add-in

Since you are the author of the Addin, I suggest that you pull the functions you want to be able to share, into a separate script, and save it as an independent script within the Addin. Then within the original script, you simply use an Include() to bring in the independent script.
For the non addin script, you will just use the method referenced by Ian, and get the directory the addin is save in, and then use an Include() to bring in the needed jsl that has the function in it.
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Calling functions that are part of an application add-in

Functions from installed Addins are not available in JSL until after the Addin has been run within the current JMP session, and then, one needs to know what NameSpace the Addin was run.

However, you may be able to restructure the original Addin to allow other JSL scripts to Include() it into the current script when needed.

Are you the author of the Addin where the function() you want to use is located?

Jim
ian_jmp
Level X

Re: Calling functions that are part of an application add-in

Building on @txnelson's thoughts, this thread may be useful.

FN
FN
Level VI

Re: Calling functions that are part of an application add-in

Yes. I am the author of the add-in as well.

txnelson
Super User

Re: Calling functions that are part of an application add-in

Since you are the author of the Addin, I suggest that you pull the functions you want to be able to share, into a separate script, and save it as an independent script within the Addin. Then within the original script, you simply use an Include() to bring in the independent script.
For the non addin script, you will just use the method referenced by Ian, and get the directory the addin is save in, and then use an Include() to bring in the needed jsl that has the function in it.
Jim