<?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 NonStop #DEF macro does not accept parameters in NonStop Servers</title>
    <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229903#M8205</link>
    <description>&lt;P&gt;#DEF macro does not seem to resolve its parameters %1%, %2% etc. anymore. Wrote a little short macro and it does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[#DEF listparam MACRO |BODY|&lt;BR /&gt;#output %1%&lt;BR /&gt;]&lt;BR /&gt;listparam abcdefg&lt;/P&gt;&lt;P&gt;Run the above and I expect to see the output and got nothing. If I do this, below (load and run listparam)&amp;nbsp; it works. I expect this to be the same. Both are macros.&lt;/P&gt;&lt;P&gt;?section listparam macro&lt;BR /&gt;#output %1%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Nov 2024 00:17:54 GMT</pubDate>
    <dc:creator>Kee_aus</dc:creator>
    <dc:date>2024-11-22T00:17:54Z</dc:date>
    <item>
      <title>NonStop #DEF macro does not accept parameters</title>
      <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229903#M8205</link>
      <description>&lt;P&gt;#DEF macro does not seem to resolve its parameters %1%, %2% etc. anymore. Wrote a little short macro and it does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[#DEF listparam MACRO |BODY|&lt;BR /&gt;#output %1%&lt;BR /&gt;]&lt;BR /&gt;listparam abcdefg&lt;/P&gt;&lt;P&gt;Run the above and I expect to see the output and got nothing. If I do this, below (load and run listparam)&amp;nbsp; it works. I expect this to be the same. Both are macros.&lt;/P&gt;&lt;P&gt;?section listparam macro&lt;BR /&gt;#output %1%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 00:17:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229903#M8205</guid>
      <dc:creator>Kee_aus</dc:creator>
      <dc:date>2024-11-22T00:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: NonStop #DEF macro does not accept parameters</title>
      <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229940#M8206</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/2210870"&gt;@Kee_aus&lt;/a&gt;&lt;/P&gt;&lt;P&gt;You may refer the below link for more information:&amp;nbsp;&lt;A href="https://support.hpe.com/hpesc/public/docDisplay?docId=a00045838en_us&amp;amp;page=id-21359.html&amp;amp;docLocale=en_US" target="_blank"&gt;https://support.hpe.com/hpesc/public/docDisplay?docId=a00045838en_us&amp;amp;page=id-21359.html&amp;amp;docLocale=en_US&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The behavior you're encountering with TACL macros seems to stem from the difference between how inline #DEF macros and macros defined in sections (?section) are resolved and executed.&lt;/P&gt;&lt;P&gt;Here's how you can fix your test case:&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[#DEF listparam MACRO |BODY|&lt;BR /&gt;#output %1%&lt;BR /&gt;]&lt;BR /&gt;listparam abcdefg&lt;/P&gt;&lt;P&gt;This works only when you explicitly invoke listparam abcdefg. Alternatively, ensure you define and test inline execution clearly:&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[#DEF listparam MACRO |BODY|&lt;BR /&gt;#output %1%&lt;BR /&gt;]&lt;BR /&gt;#CALL listparam abcdefg&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[#DEF listparam MACRO |BODY|&lt;BR /&gt;#output %1%&lt;BR /&gt;]&lt;BR /&gt;#CALL listparam abcdefg&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Or, to align with ?section behavior, define and execute immediately:&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[&lt;BR /&gt;#output abcdefg&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;If you want the ?section macro and #DEF macro to behave identically, always explicitly invoke #DEF macros after definition.&lt;/P&gt;&lt;P&gt;I hope this helps. Let me know&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 11:43:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229940#M8206</guid>
      <dc:creator>Mr_Techie</dc:creator>
      <dc:date>2024-11-22T11:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: NonStop #DEF macro does not accept parameters</title>
      <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229998#M8207</link>
      <description>&lt;P&gt;Thanks for the reply. Yeah the reference as said doesn't make this clear or how it is resolved. Is #CALL a TACL builtin? I just got a syntax error.&amp;nbsp;&lt;BR /&gt;The whole idea is to pass a parameter, obviously '#OUTPUT abcdefg' works. My macro is much more involved than this but reduce this down to a simple case to show that it is not consistent. The reference says&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;MACRO&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;specifies that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;variable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is a TACL macro.&lt;/P&gt;&lt;P class=""&gt;And it should behave like one.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2024 22:07:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7229998#M8207</guid>
      <dc:creator>Kee_aus</dc:creator>
      <dc:date>2024-11-24T22:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: NonStop #DEF macro does not accept parameters</title>
      <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7230028#M8208</link>
      <description>&lt;P&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/2210870"&gt;@Kee_aus&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're absolutely right—TACL documentation can be ambiguous when it comes to the behavior of #DEF macros, particularly around parameter resolution. Let's clarify the concepts further and address your points:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;Is #CALL a TACL Built-in?&lt;BR /&gt;No, #CALL is not a TACL command or keyword. I mentioned it incorrectly earlier, and I apologize for the confusion. TACL doesn't need a separate #CALL command to invoke a macro; you simply call the macro by name. For example, after defining listparam using #DEF, you invoke it directly by its name and pass arguments:&amp;nbsp;listparam abcdefg&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;The MACRO Behavior&lt;BR /&gt;When a variable is defined as a MACRO, TACL treats it as a template that can accept parameters (e.g., %1%, %2%) at runtime. However, defining the macro with #DEF doesn't execute it—it merely stores the definition. You must call the macro explicitly for parameter substitution to occur. Here's a minimal example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;?tacl macro&lt;BR /&gt;[#DEF listparam MACRO |BODY|&lt;BR /&gt;#output %1%&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;listparam abcdefg&lt;/P&gt;&lt;P&gt;Out put:&amp;nbsp;abcdefg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;Why Doesn't It Behave Like ?section?-&amp;nbsp;The ?section keyword works differently because it loads and executes the code immediately when the section is loaded.&amp;nbsp;&lt;/P&gt;&lt;P&gt;4.&amp;nbsp;Why Does It Seem Inconsistent? -&amp;nbsp;This inconsistency arises because TACL evaluates macros and sections at different times:&lt;/P&gt;&lt;P&gt;#DEF: Creates a reusable macro, executed only when explicitly invoked.&lt;BR /&gt;?section: Executes immediately, with no reusability unless explicitly designed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am not a expert here, just found the information for you. Let me know if that helped?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 08:21:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7230028#M8208</guid>
      <dc:creator>Mr_Techie</dc:creator>
      <dc:date>2024-11-25T08:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: NonStop #DEF macro does not accept parameters</title>
      <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7230100#M8211</link>
      <description>&lt;P&gt;2. The example you provide will not work. That was my original example to show it does not output that value.&lt;/P&gt;&lt;P&gt;3. This isn't true. If it is true then the load would have produce a syntax. It only errors if run.&lt;BR /&gt;Example:&lt;BR /&gt;\TAND1 $AUD01 TEMP 71&amp;gt; load /keep 1/ tst1&lt;BR /&gt;Loaded from $AUD01.TEMP.TST1:&lt;BR /&gt;LISTPARAM&lt;BR /&gt;\TAND1 $AUD01 TEMP 72&amp;gt; fup copy tst1&lt;BR /&gt;?section listparam macro&lt;BR /&gt;rubbish text&lt;BR /&gt;2 RECORDS TRANSFERRED&lt;/P&gt;&lt;P&gt;It is fine, it is what it is. Just inconsistent. TACL is interpretive, it only evaluates when it is asked to evaluate.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 02:30:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7230100#M8211</guid>
      <dc:creator>Kee_aus</dc:creator>
      <dc:date>2024-11-26T02:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: NonStop #DEF macro does not accept parameters</title>
      <link>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7254292#M8333</link>
      <description>&lt;P&gt;Looks like #DEF isn’t doing parameter substitution the way ?SECTION does. #DEF is more of a text replace, so %1% won’t resolve unless it’s run in a context that parses arguments. That’s why your ?SECTION version works but the #DEF one doesn’t. There’s a good thread on this in the &lt;A href="https://support.hpe.com/hpesc/public/docDisplay?docLocale=en_US&amp;amp;docId=a00045838en_us&amp;amp;page=id-21359.html" target="_blank" rel="noopener"&gt;HPE Community &lt;/A&gt;that explains the difference in more detail.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 08:08:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/nonstop-servers/nonstop-def-macro-does-not-accept-parameters/m-p/7254292#M8333</guid>
      <dc:creator>carlbid268</dc:creator>
      <dc:date>2025-08-12T08:08:33Z</dc:date>
    </item>
  </channel>
</rss>

