<?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: Macro-'Expected end of statement' Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277455#M864191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub fAdd2()&lt;/P&gt;&lt;P&gt;x=inputbox("enter x value")&lt;/P&gt;&lt;P&gt;y=inputbox("enter y value")&lt;/P&gt;&lt;P&gt; z=int(x)+ int(y)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;msgbox z&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Dec 2016 17:07:45 GMT</pubDate>
    <dc:creator>el_aprendiz111</dc:creator>
    <dc:date>2016-12-17T17:07:45Z</dc:date>
    <item>
      <title>Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277449#M864185</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 am new to VBA and trying to write below code in module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function fAdd()&lt;/P&gt;&lt;P&gt;Dim x as Integer&lt;/P&gt;&lt;P&gt;Dim y as Integer&lt;/P&gt;&lt;P&gt;fAdd=x+y&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But getting an error saying &lt;STRONG&gt;'Expected end of statement'&lt;/STRONG&gt; with as Integer being highlighted at the second line.&lt;/P&gt;&lt;P&gt;Plz help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277449#M864185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277450#M864186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Macro Qlik:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;SUB fAdd()&lt;BR /&gt; x=10&lt;BR /&gt; y=25&lt;BR /&gt; z=x+y&lt;BR /&gt; MSGBOX z&lt;BR /&gt; end SUB &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 16:38:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277450#M864186</guid>
      <dc:creator>el_aprendiz111</dc:creator>
      <dc:date>2016-12-17T16:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277451#M864187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need to declare the variables here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 16:46:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277451#M864187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-17T16:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277452#M864188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;nop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 16:48:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277452#M864188</guid>
      <dc:creator>el_aprendiz111</dc:creator>
      <dc:date>2016-12-17T16:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277453#M864189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but when you take value from user, the variable is taking string value only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub fAdd()&lt;/P&gt;&lt;P&gt;x=inputbox("enter x value")&lt;/P&gt;&lt;P&gt;y=inputbox("enter y value")&lt;/P&gt;&lt;P&gt;msgbox x+y&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say x=10 and y=15&lt;/P&gt;&lt;P&gt;Expected o/p should be 25 &lt;/P&gt;&lt;P&gt;but actual o/p is 1015&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 16:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277453#M864189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-17T16:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277454#M864190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so in this case variable needs to be declared first&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 16:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277454#M864190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-17T16:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277455#M864191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub fAdd2()&lt;/P&gt;&lt;P&gt;x=inputbox("enter x value")&lt;/P&gt;&lt;P&gt;y=inputbox("enter y value")&lt;/P&gt;&lt;P&gt; z=int(x)+ int(y)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;msgbox z&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 17:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277455#M864191</guid>
      <dc:creator>el_aprendiz111</dc:creator>
      <dc:date>2016-12-17T17:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277456#M864192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you @fer fer &lt;/P&gt;&lt;P&gt;so basically, here we don't use dim to declare a variable.right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Dec 2016 17:12:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277456#M864192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-17T17:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro-'Expected end of statement' Error</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277457#M864193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Best practice would be of course to declare the variables and also to use the &lt;STRONG&gt;option explicit&lt;/STRONG&gt; within the very first line - but what you don't need within &lt;STRONG&gt;vbs&lt;/STRONG&gt; is to specify the datatype of a variable like: Dim x &lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;as Integer&lt;/STRONG&gt;&lt;/SPAN&gt; - it will cause here an error.&lt;/P&gt;&lt;P&gt;Do you the same within &lt;STRONG&gt;vba&lt;/STRONG&gt; you should declare the datatype of a variable to save resources because without declaring each variable will be handled as object from a RAM point of view. Further helpful by larger scripts or projects is to use prefixes to the variable-name to tag the wanted/needed datatype like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sString = "s is the prefix for a string"&lt;/P&gt;&lt;P&gt;iNumber = 2016 ' i = integer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Dec 2016 12:27:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-Expected-end-of-statement-Error/m-p/1277457#M864193</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-12-18T12:27:41Z</dc:date>
    </item>
  </channel>
</rss>

