<?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: Literals as sub parameters become variables in Archived Groups</title>
    <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249556#M4013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On one hand, the behaviour of the interpreter could go down the path of&lt;/P&gt;&lt;P&gt;having a disambiguation rule that keeps things as "obvious" as possible&lt;/P&gt;&lt;P&gt;for a reader of the code; viz.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if it looks like a number, then treat it as a number unless context&lt;/P&gt;&lt;P&gt;expects &amp;amp; requires otherwise.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Four such contexts are: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statements expecting a variable name, such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET 27=abc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUB MySub(27,var2) ... ENDSUB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expressions expecting a variable name:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(27)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [27]&lt;/P&gt;&lt;P&gt;Downside: it becomes impossible to pass a variable that has a number as&lt;/P&gt;&lt;P&gt;its name as the parameter to a subroutine.&amp;nbsp; I can live with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, it could go down the path of banning numbers as&lt;/P&gt;&lt;P&gt;variable names altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The language purist in me biases me towards the latter option.&amp;nbsp; But the&lt;/P&gt;&lt;P&gt;QlikView philosophy on naming in general feels to me like it would lean&lt;/P&gt;&lt;P&gt;towards letting users have maximum flexibility to the point of&lt;/P&gt;&lt;P&gt;self-harm.&amp;nbsp; At the end of the day, I've learned to relax over the years,&lt;/P&gt;&lt;P&gt;and am not really too fussed &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; .&amp;nbsp; So long as it's well-documented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2012 00:20:22 GMT</pubDate>
    <dc:creator>gussfish</dc:creator>
    <dc:date>2012-01-05T00:20:22Z</dc:date>
    <item>
      <title>Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249547#M4004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm finding that when I use a literal value (like 31, for example) as the parameter to a user-defined subroutine, that literal becomes listed in the Variable Overview as a variable that has the literal as both the variable name an value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence, in the attached sample, you'll find I've defined a trivial subroutine TraceValue and invoked it with the parameter value 31.&amp;nbsp; On reloading (in QV Developer 10 SR3), Settings &amp;gt; Variable Overview show 31 as both Variable Name and Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone else get this behaviour?&amp;nbsp; Is there something I'm not understanding about correct use of QlikView subroutines?&amp;nbsp; I'd have thought calling a sub with a literal to be pretty elementary, and am surprised by this side-effect!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a workaround: change the literal parameter into an expression (e.g. use "57+0" instead of "57" - again, see the attached QVW).&amp;nbsp; But this is, of course, a bit clumsy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2025 14:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249547#M4004</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2025-07-23T14:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249548#M4005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it's kind of an oddity about subroutines and unquoted parms. I think Ralf has pointed it on the forums. You can avoid the implicit variable creation by quoting the literal. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call TraceValue('31');&lt;/P&gt;&lt;P&gt;vs&lt;/P&gt;&lt;P&gt;call TraceValue(31);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's because everything is evaluated. Anything not recognized as a literal (quoted), function or operator is assumed to be a variable. Variables can be automatically created by reference in the CALL statement.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 06:23:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249548#M4005</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-01-04T06:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249549#M4006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea, this is a kind of bug:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/145444#145444"&gt;http://community.qlik.com/message/145444&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes I also get empty variables (no varable name). I presume this comes from empty evaluations: $(&amp;lt;nothing&amp;gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 08:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249549#M4006</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-01-04T08:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249550#M4007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wouldn't agree that it's a bug or that it should be changed. It's actually a useful behavior. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;31 is not a QV literal.&amp;nbsp; '31' is a literal. Any parameters meant to be passed by value should be a proper string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The unusual bit is how CALL creates implicit variables. Both of these CALLs will create a variable.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL mysub(31)&lt;/P&gt;&lt;P&gt;CALL mysub(abc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters are evaluated before being read by the sub. if you pass the parm today(1), the sub receives the number, not the function call. An implicitly created variable seems to use an intial value of the name. So abc will not persist in the UI because it's evaluated value is null -- but it was created.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I find the implicit creation useful and I rely on it. Consider a SUB that "returns" a result by setting a variable. The caller should be able to pass in the variable to be set. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ByRef (retvar)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retvar = 10;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;CALL ByRef(Z);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the CALL,&amp;nbsp; variable Z=10. Z did not need to be created prior to the call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I don't know if this has anything to do with the variables created by SLEEP. That one I would call a bug because:&lt;/P&gt;&lt;P&gt;SLEEP 200;&lt;/P&gt;&lt;P&gt;SLEEP '200';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both create a variable "2000". There doesn't seem to be any way to avoid it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 18:27:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249550#M4007</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-01-04T18:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249551#M4008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see no benefit on auto-creation of variables without declarations. Only confusion and unexpected behavior. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know any programming or script language with this behavior. This is very unusual. Also I cannot understand why a variable name can consist of digits only or even is &amp;lt;nothing&amp;gt;. Nobody would expect this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw. there is no equal treatment of numerical parameters at all: Why today(1) isn't creating a variable "1"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your example of passing today(1) as a parameter which results into a number (the date) because it's evaluated is indeed a normal behavior which I would expect. This is a normal functional nesting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this concept would need more clarification from the creator.. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 21:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249551#M4008</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-01-04T21:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249552#M4009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the risk of breaking my New Years resolution to stop trying to have the last word...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;I see no benefit on auto-creation of variables without declarations. Only confusion and unexpected behavior.&lt;/P&gt;&lt;P&gt;I thought I pointed out a great benefit - no need to predefine return variables. But what would you have them do if the variable wasn't predefined? Throw a runtime error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;I don't know any programming or script language with this behavior. This is very unusual.&lt;/P&gt;&lt;P&gt;I think it's very common in scripting languages. For example, VBScript (w/o option explicit) and REXX to name two. QT actually copied the VBScript behavior for creating and copying out variables. For example, in VBScript:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Sub mysub (parm1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parm1 = "hello"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;End Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Sub testit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call mysub(abc)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox abc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'abc will have the value &lt;STRONG&gt;"hello"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;End Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REXX also uses the convention of initializing variables to the same value as the variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Also I cannot understand &amp;gt;why a variable name can consist of digits only or even is &amp;lt;nothing&amp;gt;. Nobody would &amp;gt;expect this.&lt;/P&gt;&lt;P&gt;I'l admit that "allowing" variable names with digits only&amp;nbsp; is strange. I put allowing in quotes because the syntax editor does flag:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET 27=68&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;with a red line syntax error squiggle. But it will execute and there is nothing in the doc that says it's not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Btw. there is no equal treatment of numerical parameters at all: Why today(1) isn't creating a variable "1"?&lt;/P&gt;&lt;P&gt;I may be misunderstanding your point, but I don't see the relationship between how native functions behave and script SUBs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;Your example of passing today(1) as a parameter which results into a number (the date) because it's evaluated is &amp;gt;indeed a normal behavior which I would expect. This is a normal functional nesting.&lt;/P&gt;&lt;P&gt;I misspoke. It's actually the string form of the date that's passed, not the number.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;I think this concept would need more clarification from the creator.. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think that would be great. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I contributed to this thread because I wanted to make a few points I thought were useful. &lt;/P&gt;&lt;P&gt;1. Don't change this behavior without serious consideration. A lot of script will break.&lt;/P&gt;&lt;P&gt;2. Variables can be passed by reference -- myvar -- or value -- '$(myvar)'. I find it handy to have both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 23:28:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249552#M4009</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-01-04T23:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249553#M4010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't mind the QV behaviour of implicitly creating variables (Sorry Ralf!) - it's not an uncommon approach in a variety of languages, so I've become comfortable enough with it.&amp;nbsp; (It is, however, an undocumented 'feature').&amp;nbsp; But I don't think it should occur when a literal is the parameter, and think it contravenes the Reference Manual (for QV10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before I justify that statement: I'm going to change terminology and now use the term "constants" rather than "literals", because I've just looked in the QV10 Reference Manual and found that this is the term it uses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the commentary on Call (p294) states "Each item in the list [of the actual parametes] may be a field name, a variable name or an arbitrary expression.".&amp;nbsp; (The Script interpreter is clearly treating a numeric value as the 2nd option - a variable name).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The commentary on Expression Syntax (p365 / s. 22.1) states that the general syntax for an expression is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;expression ::=( constant |&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldref |&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; operator1 expression |&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression operator2 expression|&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function |&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( expression ) )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;EM&gt;constant &lt;/EM&gt;is a string ... enclosed by single straight quotation marks ... or a number. ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So, a value such a 10 clearly qualifies as a &lt;EM&gt;constant&lt;/EM&gt;, and a &lt;EM&gt;constant &lt;/EM&gt;clearly qualifies as an &lt;EM&gt;expression &lt;/EM&gt;in and of itself, without requiring there to be any operator.&amp;nbsp; Finally, returning to the CALL commentary, "if the parameter in the call statement is a variable name, copied back out again upon exit from the subroutine."&amp;nbsp; By implication, this behaviour shouldn't happen with parameters other than variable names.&amp;nbsp; Consequently, IMO, the CALL statement should treat such a value as an expression, not a variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consequently, I'm expecting that the script interpreter should be able to tell the difference between a variable name and a numeric constant in the context of a call statement.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, if it makes this distinction, then I don't think your code, Rob, would break, since the interpreter will (correctly) identify your variable names as variables rather than constants, and so do the correct passing-back behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 23:43:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249553#M4010</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2012-01-04T23:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249554#M4011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice analysis Angus. I agree that numbers should be treated as expressions and therefore not generate a variable. And I don't think that change only would break any existing script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's implementation might be a bit awkward. While &lt;/P&gt;&lt;P&gt;SET 27 = 32 &lt;/P&gt;&lt;P&gt;is currently allowed, what should be behavior of&lt;/P&gt;&lt;P&gt;CALL mysub(27)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass the number 27 or a pointer to the variable 27? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 23:56:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249554#M4011</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-01-04T23:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249555#M4012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd say that the variable syntax shouldn't allow variables that can be evaluated as numbers, like 27.&amp;nbsp; It should therefore error on the set, and the call would be passing a number.&amp;nbsp; (Edit: For backwards compatibility purposes, I wouldn't actually make this change.&amp;nbsp; This is just how I think it should have worked.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We already have a mechanism for handling the situation, though.&amp;nbsp; If I create a variable 27 with value 32, then 27 = 27, but [27] = 32.&amp;nbsp; So just structure your call appropriately:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CALL mysub(27)&amp;nbsp;&amp;nbsp; // This is passing the number 27&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;CALL mysub([27]) // This is passing the variable 27, with value 32&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not actually tried these to see if they behave like I would expect.&amp;nbsp; But that's what I'd expect, and if it doesn't work that way, that's how I'd suggest it &lt;EM&gt;should&lt;/EM&gt; work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 00:09:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249555#M4012</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-01-05T00:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249556#M4013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On one hand, the behaviour of the interpreter could go down the path of&lt;/P&gt;&lt;P&gt;having a disambiguation rule that keeps things as "obvious" as possible&lt;/P&gt;&lt;P&gt;for a reader of the code; viz.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if it looks like a number, then treat it as a number unless context&lt;/P&gt;&lt;P&gt;expects &amp;amp; requires otherwise.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Four such contexts are: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statements expecting a variable name, such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET 27=abc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUB MySub(27,var2) ... ENDSUB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expressions expecting a variable name:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(27)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [27]&lt;/P&gt;&lt;P&gt;Downside: it becomes impossible to pass a variable that has a number as&lt;/P&gt;&lt;P&gt;its name as the parameter to a subroutine.&amp;nbsp; I can live with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, it could go down the path of banning numbers as&lt;/P&gt;&lt;P&gt;variable names altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The language purist in me biases me towards the latter option.&amp;nbsp; But the&lt;/P&gt;&lt;P&gt;QlikView philosophy on naming in general feels to me like it would lean&lt;/P&gt;&lt;P&gt;towards letting users have maximum flexibility to the point of&lt;/P&gt;&lt;P&gt;self-harm.&amp;nbsp; At the end of the day, I've learned to relax over the years,&lt;/P&gt;&lt;P&gt;and am not really too fussed &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; .&amp;nbsp; So long as it's well-documented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 00:20:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249556#M4013</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2012-01-05T00:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249557#M4014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've played around a bit. These variants are working w/o variable creation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL mysub(27+0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL mysub((27));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 08:07:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249557#M4014</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-01-05T08:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249558#M4015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your 2nd variant - parenthesising the value - gets the prize for the most elegant workaround, Ralf, with the added bonus that it would also be the best-performing option, since it incurs no arithmetic or conversion operations.&amp;nbsp; Very nice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 22:33:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249558#M4015</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2012-01-05T22:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249559#M4016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I'm feeling that this discussion has run its course - and have thoroughly enjoyed interacting with you all, I might add - and would like to pull-together some conclusions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A. I think we're all agreed that it's a bona fide defect that Qlikview is turning numeric constants into variables when provided as subroutine parameters, especially since the Reference Manual is pretty clear that this shouldn't be an expected result.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Am I right in reading we're agreeing on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B. The cleanest, best-performing workaround is to put such constants in parentheses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C. It's up to QlikTech how they resolve this, of course, but it seems like the platform needs to have a token-interpretation rule that interprets tokens that look like numeric constants as numeric constants, unless the linguistic context requires a variable name.&amp;nbsp; This should provide satisfactory backward-compatibility for coding techniques that use implicit variable creation in the context of value-passback in subroutine calls, since surely no-one in their right mind would want to use this technique using a sequence of only digits as the variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;D. We've discussed a few language philosophy issues, which I'll name for completeness, but these clearly won't be resolved in this thread: desireability of implicit variable creation; consistency of parameter treatment between user-defined subroutines, built-in subroutines and built-in functions; flexibility of variable-name rules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 22:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249559#M4016</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2012-01-05T22:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249560#M4017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice summary Angus. Thanks for your contributions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now does someone want to open the ticket and see if we can get a bug?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 04:48:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249560#M4017</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-01-06T04:48:13Z</dc:date>
    </item>
    <item>
      <title>Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249561#M4018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just an additional note. In the case of sleep (maybe other statements too) parenthesising the value wouldn't be enough:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sleep (1200);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // will create variable "("&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sleep (1200+0);&amp;nbsp; // will not create any variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 08:59:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249561#M4018</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2012-01-06T08:59:26Z</dc:date>
    </item>
    <item>
      <title>Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249562#M4019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Done.&amp;nbsp; Case 00087203. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2012 23:09:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249562#M4019</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2012-01-11T23:09:15Z</dc:date>
    </item>
    <item>
      <title>Literals as sub parameters become variables</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249563#M4020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;Confirmed by QlikTech Issue Analysis team as a bug, ID 44972.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 10pt;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;"Due to uncertainties regarding potential related problems and program priorities we cannot guarantee a fix date at this time."&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 01:40:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Literals-as-sub-parameters-become-variables/m-p/249563#M4020</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2012-02-13T01:40:49Z</dc:date>
    </item>
  </channel>
</rss>

