Running a JSL script within another JSL scriptHello
I hope this one is easy, but I'm having difficulties figuring it out (new JSL user)...
I have a "large" JSL script, of which within it, I want to run a "short" JSL script. However, I do not want to put the code of the shorter script within the larger one since the same code is used within several of my scripts (its a database query builder).
Is there a way to simply run the shorter script (it's on my drive: Q:\Tissue Effect Research\JMP\JMP Apps and Scripts - Read Only\Data Puller) from the larger one?
Thanks, Jim
Re: Running a JSL script within another JSL scriptTry the Include() function.
Re: Running a JSL script within another JSL scriptPerfect - that works....thanks!Re: Running a JSL script within another JSL scriptJim,
I Strongly suggest that you read the Scripting Guide.
Help==>Books==>Scripting Guide
It will give you the base of the structure of JSL, and give you a real leg up on knowing what is available within JSL. It will let you move much faster, rather than having to wait for someone in the Discussion Community to respond.Re: Running a JSL script within another JSL scriptInclude() is great for running code within another JSL script. You should also look into defining your own functions, because then you can call them within your larger script with parameters. User-defined functions are documented in Help > Books > Scripting Guide, on page 258 (version 12.2).
Here's a simple example function:
add3 = Function({a, b, c},
// Add up the three arguments
tmp = a + b + c;
// The last statement will return the value of tmp to the caller
tmp;
);
Here are some sample calls to this newly defined function:
x = add3(1, 5, 9);
z = add3(3.14159, 2.7183, 6.721);
Re: Running a JSL script within another JSL scriptThanks for the solution
Re: Running a JSL script within another JSL scriptCan JSL use "go to"?
Thanks!
Re: Running a JSL script within another JSL scriptInclude is used when you want to run script from file (or include some functionality of it). To run table script you can use << Run Script
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Run Script("Distribution");Re: Running a JSL script within another JSL scriptHi, I tried to use the "include" function. But I can't manage to make it work.
I have a table with a script called "Cleanup" and one "Run D6708 analysis" (see attachment).
How can I call the script "Cleanup" within the script "Run D6708" ?
Thanks

Re: Running a JSL script within another JSL scriptHi Jeff,
I met the same question and tried include() function. Could you teach me how to setup name for the data table from the script that I include?
Below is the script I use now. It didn't work. I need a table name for future scripting.
dt_template = Current Data Table();
dt_template = include("A");
Thanks a lot
Re: Running a JSL script within another JSL script
THANKS:)
Really, for the question (which many of us must be asking) and the answer (which may seem simple to experts but which for novices is not easy to find in the "scripting index")
Re: Running a JSL script within another JSL scriptI understand your comment about the Scripting Index for the novice user. For novice users, I do think the Scripting index is very helpful for looking at someone's JSL and when something is not understood, taking the function, etc. and then going to the Scripting Index, because one knows exactly what they are looking for.
On the other hand, what I do find extremely helpful for the Novice user, is the Scripting Guide. It allows the new user to learn all about the structure of JSL.