cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Neo
Neo
Level VI

Running a script after making a change. Not working without closing and re-opening the script -why?

I am learning JSL and getting a behaviour which I do not think I got when I started. I would like to know if this behaviour is expected or if it is occurring due to a setting change I may have made inadvertently.

I have a simple "main" script which calls a function and another script. When I open JMP fresh and run fresh the main script or the other function/scripts it calls, all of them run fine and produce expected results. However, they do not work when I make a change in any of them (e.g. if I comment the script which is included in the main script, e.g. the last line below). If I close all the open scripts then re-fire them they work again. Coming from other programming languages I do not expect such a behaviour. Any direction is much appreciated

Examples of my mainscript below (I am on JMP13). 

 

getDataTable = getDataTable4partID("partID","partIDname");
include ("plotallcharts.jsl");
include ("generateJournal.jsl");

Commenting the last line above (or if I uncomment clear log ()) i.e.

//clear log ();
getDataTable = getDataTable4partID("partID","partIDname");
include ("plotallcharts.jsl");
//include ("generateJournal.jsl");

gives me the following error in the above script

Name Unresolved: getDataTable4partID in access or evaluation of 'getDataTable4partID' , getDataTable4partID( "partID", "partIDname" ) /*###*/

Closing all open scripts and functions (and sometimes JMP) and firing back them again seems to get everything working again. Not sure what is going on....

Any direction is much appreciated.

 

 

When it's too good to be true, it's neither
10 REPLIES 10
txnelson
Super User

Re: Running a script after making a change. Not working without closing and re-opening the script -why?

Yes, the getDataTable4partID function must be parsed by JSL prior to you being able to call it.  The include statement, reads in the function, and loads it into memory.  Once it is in memory, it can be called.

Jim