<?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 Must_Include in FOR-EACH, and my SUBs are broken in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Must-Include-in-FOR-EACH-and-my-SUBs-are-broken/m-p/1195550#M627614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a little "helper library" for my dashboards which is just a .qvs file, and now I want to split this file into modules so multiple colleagues could work on different topics at the same time. When I had my library as a single file, I just included it into my dashboard by using Must_Include and I was fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, with "modules" (which are also plain .qvs files), I made two solutions, but the nice one does not work. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/cry.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;first&lt;/STRONG&gt; solution is to have the library as a little script which is just a list of Must_include statements to include the single modules. This works well, I have all my variables, SUBs can be called from the dashboard, and code works, too. But of course it is a pity if all the modules are hard-coded in my loader library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;second&lt;/STRONG&gt; solution is to have the library as a little script again which loads the modules, but I use a FOR-EACH loop to take every file with "module" in its name that exists in a given file folder. This is more flexible when adding or removing modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This second solution provides me with the variables that I define there and also executes the code that is directly put in a module. But I also put some SUBs in each module, so I can call them later when I need them in my dashboard's script. I am not able to call the SUBs anymore, neither from the library nor from the dashboard script (which basically loads the library).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you experienced anything like this before? I know that Must_Include is a little "special" (it is also executed when it is put after a bunch of "EXIT SCRIPT"s and so on). But I hope to find a way to get the modules loaded with FOR EACH and still keep my SUBs available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Oct 2016 16:38:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-10-26T16:38:35Z</dc:date>
    <item>
      <title>Must_Include in FOR-EACH, and my SUBs are broken</title>
      <link>https://community.qlik.com/t5/QlikView/Must-Include-in-FOR-EACH-and-my-SUBs-are-broken/m-p/1195550#M627614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a little "helper library" for my dashboards which is just a .qvs file, and now I want to split this file into modules so multiple colleagues could work on different topics at the same time. When I had my library as a single file, I just included it into my dashboard by using Must_Include and I was fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, with "modules" (which are also plain .qvs files), I made two solutions, but the nice one does not work. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/cry.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;first&lt;/STRONG&gt; solution is to have the library as a little script which is just a list of Must_include statements to include the single modules. This works well, I have all my variables, SUBs can be called from the dashboard, and code works, too. But of course it is a pity if all the modules are hard-coded in my loader library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;second&lt;/STRONG&gt; solution is to have the library as a little script again which loads the modules, but I use a FOR-EACH loop to take every file with "module" in its name that exists in a given file folder. This is more flexible when adding or removing modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This second solution provides me with the variables that I define there and also executes the code that is directly put in a module. But I also put some SUBs in each module, so I can call them later when I need them in my dashboard's script. I am not able to call the SUBs anymore, neither from the library nor from the dashboard script (which basically loads the library).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you experienced anything like this before? I know that Must_Include is a little "special" (it is also executed when it is put after a bunch of "EXIT SCRIPT"s and so on). But I hope to find a way to get the modules loaded with FOR EACH and still keep my SUBs available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 16:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Must-Include-in-FOR-EACH-and-my-SUBs-are-broken/m-p/1195550#M627614</guid>
      <dc:creator />
      <dc:date>2016-10-26T16:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Must_Include in FOR-EACH, and my SUBs are broken</title>
      <link>https://community.qlik.com/t5/QlikView/Must-Include-in-FOR-EACH-and-my-SUBs-are-broken/m-p/1195551#M627615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After playing around with this, I come to the conclusion that Must_Include seems to be a plain text replacement. That means, in a FOR-EACH-NEXT loop the text of the included file would be put within the loop and therefore may be forgotten outside the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expectation would be something like "import java.io.*;" in Java does. But when Must_Include is a plain text replacement, such a "module import" must be done differently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 08:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Must-Include-in-FOR-EACH-and-my-SUBs-are-broken/m-p/1195551#M627615</guid>
      <dc:creator />
      <dc:date>2016-10-27T08:50:28Z</dc:date>
    </item>
  </channel>
</rss>

