- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to include another script in current script
Hello all,
I have two scripts A and B. Script A and B both use the same data table. And what script A can do is updating columns for the data table.
I want to open the data table, call script A, and then use the table from script A to do the future analysis. But my code doesn't work.
Below is a part of my script. I think the script A is called successfully, but the script after include function can't work. It is my first-time use include function. Can someone help me with it?
I appreciate your help a lot!
dt_template = Current Data Table();
dt_template = include("XXX");
dt_template << New Column( "L",
Character,
Nominal,
Formula(
),
eval formula
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to include another script in current script
@Anonymous,
You may use the Include() to achieve what you want. One suggestion I would offer is look at expressions as well. You can achieve better control over your code by making it as expressions. However, here is one way to achieve what you want, this goes into "Wrapper.jsl"
Clear Log(); Clear Globals(); Close All(DataTables,"No Save");
dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );
Include("C:\Script A.jsl"); // put your custom file path where you save Script A
Wait(0.2); // For demo purposes
Include("C:\Script B.jsl"); // put your custom file path where you save Script A
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to include another script in current script
@Anonymous,
You may use the Include() to achieve what you want. One suggestion I would offer is look at expressions as well. You can achieve better control over your code by making it as expressions. However, here is one way to achieve what you want, this goes into "Wrapper.jsl"
Clear Log(); Clear Globals(); Close All(DataTables,"No Save");
dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );
Include("C:\Script A.jsl"); // put your custom file path where you save Script A
Wait(0.2); // For demo purposes
Include("C:\Script B.jsl"); // put your custom file path where you save Script A
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to include another script in current script
Thanks! Small typo: last comment should be " ... save script B"