<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trying to use Include Files List() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230396#M45688</link>
    <description>Understood. Thanks a lot. Explanation in the scripting index or help is definitely not enough to understand which way the nesting goes: either it's all the scripts that are included into a script it's been called form or all the scripts that come from where it called to the root one.</description>
    <pubDate>Wed, 23 Oct 2019 17:49:00 GMT</pubDate>
    <dc:creator>miguello</dc:creator>
    <dc:date>2019-10-23T17:49:00Z</dc:date>
    <item>
      <title>Trying to use Include Files List()</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230133#M45658</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use Include File List() and I'm getting errors. It is not working as I would have expected.&lt;/P&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;I have 3 files files named Include1.jsl,&amp;nbsp;Include2.jsl,&amp;nbsp;Include3.jsl that I'm trying to include into TestInclude.jsl that is listed below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log();
//Names Default To Here( 1 );
Clear Symbols();
Clear Globals();

Include( "Include1.jsl" );
Include( "Include2.jsl" );
Include( "Include3.jsl" );


show(Include File List());&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All four files are in the same folder.&amp;nbsp; Each of the three included files have their corresponding&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;show("IncludeScriptN");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where N is 1, 2 and 3&lt;/P&gt;&lt;P&gt;When I'm running the TestInclude,jsl, I'm expecting to see:&lt;/P&gt;&lt;PRE&gt;"IncludeScript1";&lt;BR /&gt;"IncludeScript2";&lt;BR /&gt;"IncludeScript3";&lt;BR /&gt;Include File List() = {"C:\...\TestingLocaleScipts\TestInclude.jsl", "C:\...\TestingLocaleScipts\Include1.jsl", "C:\...\TestingLocaleScipts\Include2.jsl", "C:\...\TestingLocaleScipts\Include3.jsl"};&lt;/PRE&gt;&lt;P&gt;Instead I see this:&lt;/P&gt;&lt;PRE&gt;"IncludeScript1";
"IncludeScript2";
"IncludeScript3";
Include File List() = {"C:\...\TestingLocaleScipts\TestInclude.jsl"}&lt;/PRE&gt;&lt;P&gt;So, included files ARE indeed included, they DO indeed work, but function does not show them? What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 19:07:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230133#M45658</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2019-10-22T19:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use Include Files List()</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230271#M45667</link>
      <description>&lt;P&gt;The function returns the current nesting of included files. At the root level, where you've called it, there is only one file, no actual nesting. Try calling it from one of the included files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;fn1 = Save Text File( "$temp/a.jsl", "show(&lt;SPAN&gt;Include File List&lt;/SPAN&gt;())" );
fn2 = Save Text File( "$temp/b.jsl", "include(fn1)" );
Include( fn2 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Include File List() = {"C:\Users\v1\AppData\Local\Temp\a.jsl", "C:\Users\v1\AppData\Local\Temp\b.jsl", "Script.jsl"};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;script.jsl is the name of the unsaved root-level script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function is for implementing custom error reporting; if something goes wrong in a &lt;EM&gt;try()&lt;/EM&gt; in the fn1 file, you can write the &lt;EM&gt;catch&lt;/EM&gt; clause to report the nested includes. &lt;EM&gt;As a cool side effect, it also gives you the name of the current script file.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two ways to use include files: you might think of them as function libraries, or you might think of them as blocks of code to execute. The&amp;nbsp;&lt;EM&gt;Include File List&lt;/EM&gt; is not very useful if they are function libraries because most of the code is not executing while the include is running...it defines the functions and returns. But if the include file is a block of code that runs when included, and might include more blocks of code, then&amp;nbsp;&lt;EM&gt;Include File List&lt;/EM&gt; might be helpful for debugging.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 09:21:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230271#M45667</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-10-23T09:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use Include Files List()</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230369#M45683</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Retired and still working?&lt;/P&gt;
&lt;P&gt;Can you explain what you mean with the custom error reporting?&amp;nbsp; Are you saying just for what script the error happened in?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because I thought the main function was to show you what script you're in at the time of call.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all of your child scripts are only functions that don't run, then you don't actually see the include file list() nesting right?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);
fn1 = Save Text File( "$temp/a.jsl", "show(Include File List()); f2 = function({}, include file list());" );
fn2 = Save Text File( "$temp/b.jsl", "include(fn1); f = function({}, include file list());" );
Include( fn2 );
show(f(), f2());&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Oct 2019 16:55:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230369#M45683</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2019-10-23T16:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use Include Files List()</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230396#M45688</link>
      <description>Understood. Thanks a lot. Explanation in the scripting index or help is definitely not enough to understand which way the nesting goes: either it's all the scripts that are included into a script it's been called form or all the scripts that come from where it called to the root one.</description>
      <pubDate>Wed, 23 Oct 2019 17:49:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230396#M45688</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2019-10-23T17:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use Include Files List()</title>
      <link>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230460#M45703</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2610"&gt;@vince_faller&lt;/a&gt;&amp;nbsp;Pretty sure calling IncludeFileList from a user defined function has to return the current stack of include files and not the stack that existed when the function was being defined. As your example hints, you can capture the stack at function definition time by executing IncludeFileList within the included file, but outside of a function definition.&lt;/P&gt;&lt;P&gt;I do think one of the best use cases is to get the name of the current file from list item 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 22:24:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Trying-to-use-Include-Files-List/m-p/230460#M45703</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-10-23T22:24:20Z</dc:date>
    </item>
  </channel>
</rss>

