<?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 How to debug a macro crashing in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149201#M504555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can modify the function as and then call this on a Button click&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let&lt;/STRONG&gt; Dummy1 = TestMyFunction();&lt;/P&gt;&lt;P&gt;Here the macro:&lt;BR /&gt;&lt;B&gt;function&lt;/B&gt; TestMyFunction&lt;BR /&gt; &lt;B&gt;set&lt;/B&gt; ActQvDoc = ActiveDocument&lt;BR /&gt; dummy = ActQvDoc.Variables("UserNameOs").SetContent ("Hallo4", &lt;B&gt;true&lt;/B&gt;)&lt;/P&gt;&lt;P&gt;Msgbox dummy 'This will give you value of Variable&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;B&gt;TestMyFunction =&lt;/B&gt; dummy&lt;/P&gt;&lt;P&gt;&lt;B&gt;end&lt;/B&gt; &lt;B&gt;function&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Also there is a Debug button given in Macro editor. you can use that.&lt;/B&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2009 19:03:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-13T19:03:19Z</dc:date>
    <item>
      <title>How to debug a macro crashing in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149199#M504553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;For general understanding I have writen a macro which is to be executed at several locations.&lt;BR /&gt;My macros name is TestMyFunction.&lt;/P&gt;&lt;P&gt;If I click on a textbox with my macro configured on the action "execute macro", all is running fine.&lt;/P&gt;&lt;P&gt;But when I execute the macro in the script, qlikview closes without any trace.&lt;BR /&gt;Here the script code&lt;BR /&gt;&lt;B&gt;let&lt;/B&gt; Dummy1 = TestMyFunction();&lt;/P&gt;&lt;P&gt;Here the macro:&lt;BR /&gt;&lt;B&gt;function&lt;/B&gt; TestMyFunction&lt;BR /&gt; &lt;B&gt;set&lt;/B&gt; ActQvDoc = ActiveDocument&lt;BR /&gt; dummy = ActQvDoc.Variables("UserNameOs").SetContent ("Hallo4", &lt;B&gt;true&lt;/B&gt;)&lt;BR /&gt; &lt;B&gt;TestMyFunction =&lt;/B&gt; "Hallo1"&lt;BR /&gt;end &lt;B&gt;function&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Now how can I debug such a case when QlikView is disappearing as soon as I execute the script?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 17:22:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149199#M504553</guid>
      <dc:creator />
      <dc:date>2009-07-13T17:22:10Z</dc:date>
    </item>
    <item>
      <title>How to debug a macro crashing in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149200#M504554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't believe that you can interact with the ActiveDocument like this from within the script. There have been restrictions on it in recent versions.&lt;/P&gt;&lt;P&gt;What, exactly, are you trying to achieve?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 17:48:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149200#M504554</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2009-07-13T17:48:45Z</dc:date>
    </item>
    <item>
      <title>How to debug a macro crashing in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149201#M504555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can modify the function as and then call this on a Button click&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;let&lt;/STRONG&gt; Dummy1 = TestMyFunction();&lt;/P&gt;&lt;P&gt;Here the macro:&lt;BR /&gt;&lt;B&gt;function&lt;/B&gt; TestMyFunction&lt;BR /&gt; &lt;B&gt;set&lt;/B&gt; ActQvDoc = ActiveDocument&lt;BR /&gt; dummy = ActQvDoc.Variables("UserNameOs").SetContent ("Hallo4", &lt;B&gt;true&lt;/B&gt;)&lt;/P&gt;&lt;P&gt;Msgbox dummy 'This will give you value of Variable&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;B&gt;TestMyFunction =&lt;/B&gt; dummy&lt;/P&gt;&lt;P&gt;&lt;B&gt;end&lt;/B&gt; &lt;B&gt;function&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Also there is a Debug button given in Macro editor. you can use that.&lt;/B&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 19:03:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149201#M504555</guid>
      <dc:creator />
      <dc:date>2009-07-13T19:03:19Z</dc:date>
    </item>
    <item>
      <title>How to debug a macro crashing in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149202#M504556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;Hello Stephen&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;I'm working with version 9.00.7119.4, Personal Edition for these tests.&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;I would like to set the value of a self defined variable, in this case "UserNameOs".&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;But as I see in the script I have to use the statement:&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;Set UserNameOs = "AValue";&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;What a pity.&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;Usualy I use macros (functions) to avoid redundancies, but obviously in the macro I can't access a variable in the same way as in the script.&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;So the ability to define variables and to write macros is in a way obsolete.&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;Thanks for help&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;Valerio&lt;/DIV&gt;&lt;DIV dir="ltr" style="text-align: left"&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 23:45:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149202#M504556</guid>
      <dc:creator />
      <dc:date>2009-07-13T23:45:02Z</dc:date>
    </item>
    <item>
      <title>How to debug a macro crashing in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149203#M504557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;This method do not work for debugging as QV is obviously dying at the statement&lt;/P&gt;&lt;P&gt;dummy = ActQvDoc.Variables("UserNameOs").SetContent ("Hallo4", &lt;B&gt;true&lt;/B&gt;)&lt;/P&gt;&lt;P&gt;Thanks Valerio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 23:49:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149203#M504557</guid>
      <dc:creator />
      <dc:date>2009-07-13T23:49:38Z</dc:date>
    </item>
    <item>
      <title>How to debug a macro crashing in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149204#M504558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way for a macro to set a variable from in a load script, without using ActiveDocument:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET UserNameOs=TestMyFunction();&lt;BR /&gt;where the macro is:&lt;BR /&gt;Function TestMyFunction&lt;BR /&gt; TestMyFunction = "foo"&lt;BR /&gt;End Function&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;If you need to read a variable value in the macro, you'll have to pass it as a parameter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET vX = 1;&lt;BR /&gt;LET vY = addTwo($(vX);&lt;BR /&gt;where the macro is:&lt;BR /&gt;Function addTwo (input)&lt;BR /&gt; addTwo = input + 2&lt;BR /&gt;End Function&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 00:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-debug-a-macro-crashing-in-script/m-p/149204#M504558</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-07-14T00:02:56Z</dc:date>
    </item>
  </channel>
</rss>

