&&arg: Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
<p class="syntax">&amp;&amp;arg(''n'') </p>
<p class="syntax">&amp;&amp;arg(''n'') </p>


where ''n'' is a numeric constant, or a [[working_with_macro_variables.html|macro variable]]. </span>
where ''n'' is a numeric constant, or a [[Working with macro variables|macro variable]]. </span>


<span class="f_Para">Designed for commands that have multiple arguments, this function parses the blank-delimited, user-provided string to determine the replacement values for the </span><span class="f_Monospace">&amp;&amp;arg</span><span class="f_Para"> occurrences within the command. The first such value in the string replaces </span><span class="f_Monospace">&amp;&amp;arg(1)</span><span class="f_Para">, the second replaces </span><span class="f_Monospace">&amp;&amp;arg(2)</span><span class="f_Para">, and so on. </span>
<span class="f_Para">Designed for commands that have multiple arguments, this function parses the blank-delimited, user-provided string to determine the replacement values for the </span><span class="f_Monospace">&amp;&amp;arg</span><span class="f_Para"> occurrences within the command. The first such value in the string replaces </span><span class="f_Monospace">&amp;&amp;arg(1)</span><span class="f_Para">, the second replaces </span><span class="f_Monospace">&amp;&amp;arg(2)</span><span class="f_Para">, and so on. </span>


<span class="f_Para">The </span><span class="f_Monospace">[[passing_arguments_to_macros.html#using_argstring|&amp;argstring]]</span><span class="f_Para"> variable is a placeholder designed for single-argument commands within a macro. </span>
<span class="f_Para">The </span><span class="f_Monospace">[[Passing a command argument to a macro#Using the &argstring variable|&amp;argstring]]</span><span class="f_Para"> variable is a placeholder designed for single-argument commands within a macro. </span>


<span class="f_Para">If a command takes a single argument, or you want to treat whatever is passed to the command as a single string (even if it contains blanks), use the </span><span class="f_Monospace">[[passing_arguments_to_macros.html#using_argstring|&amp;argstring]]</span><span class="f_Para"> variable instead of the </span><span class="f_Monospace">&amp;&amp;arg</span><span class="f_Para"> function. </span>
<span class="f_Para">If a command takes a single argument, or you want to treat whatever is passed to the command as a single string (even if it contains blanks), use the </span><span class="f_Monospace">[[Passing a command argument to a macro#Using the &argstring variable|&amp;argstring]]</span><span class="f_Para"> variable instead of the </span><span class="f_Monospace">&amp;&amp;arg</span><span class="f_Para"> function. </span>
|-
|-
| '''Scope:'''
| '''Scope:'''

Revision as of 17:45, 9 March 2023

Action:

Serves as a placeholder for a command argument within a macro (if used outside of a macro, an error is issued). The argument that takes the place of &&arg is dynamically provided by the Client user.

Syntax:

&&arg(n

where n is a numeric constant, or a macro variable.

Designed for commands that have multiple arguments, this function parses the blank-delimited, user-provided string to determine the replacement values for the &&arg occurrences within the command. The first such value in the string replaces &&arg(1), the second replaces &&arg(2), and so on.

The &argstring variable is a placeholder designed for single-argument commands within a macro.

If a command takes a single argument, or you want to treat whatever is passed to the command as a single string (even if it contains blanks), use the &argstring variable instead of the &&arg function.

Scope: Allowed only in Debugger macros.
Introduced: Build 28