Set command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "__TOC__ {| |width="50%"| '''Action:''' |width="50%"| <span class="f_Para">Lets you create and initialize macro variables. Variable name...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


{|
{|
|width="50%"| '''Action:'''  
|width="125px"| '''Action:'''
|width="50%"|
|width="775px"|
<span class="f_Para">Lets you create and initialize [[working_with_macro_variables.html|macro variables]]. Variable names begin with a single ampersand (&amp;), and variable values include constants, User Language variables, fields, and $list elements, and other macro variables and [[working_with_macro_functions.html|functions]]. </span>
<span class="f_Para">Lets you create and initialize [[Working with macro variables|macro variables]]. Variable names begin with a single ampersand (&amp;), and variable values include constants, User Language variables, fields, and $list elements, and other macro variables and [[Working with Client functions (Debugger)|functions]]. </span>


'''Syntax:'''  
'''Syntax:'''  


<p class="syntax">set &''target''= ''string''|[-]''n''|&amp;''var''|%''xxx''|[[watch_global_variables.html|g.xxx]]|[[watch_global_variables.html|g.'xxx']]|f.''xxx''
<p class="syntax">set &''target''= ''string''|[-]''n''|&amp;''var''|%''xxx''|[[Watching global variables|g.xxx]]|[[Watching global variables|g.'xxx']]|f.''xxx''
       |$listcnt(''x'')|$listinf(''x,y'') </span>
       |$listcnt(''x'')|$listinf(''x,y'') </span>
       |&amp;&amp;''function''[(''args'')] </span></p>
       |&amp;&amp;''function''[(''args'')] </span></p>
Line 19: Line 19:
*&amp;''var'' is a previously defined macro variable.  
*&amp;''var'' is a previously defined macro variable.  
*''%xxx'' is a mainframe variable.  
*''%xxx'' is a mainframe variable.  
*g''.xxx'' or g.'xxx' is a [[watch_global_variables.html|global variable reference]].
*g''.xxx'' or g.'xxx' is a [[Watching global variables|global variable reference]].
*f.''xxx'' is a [[watching_fields.html|field reference]], possibly with a subscript.  
*f.''xxx'' is a [[Watching Model 204 fields|field reference]], possibly with a subscript.  
*$listcnt/$listinf are the Debugger functions for [[watching_$lists.html|viewing $list counts and elements.]]  
*$listcnt/$listinf are the Debugger functions for [[Watching $lists, Stringlists, and Arraylists|viewing $list counts and elements.]]  
*&amp;&amp;''function'' is a macro function.  
*&amp;&amp;''function'' is a macro function.  


'''Note:''' To set a macro variable or macro function in a Client [[setup_ui_xml_file.html#mapping_element|mapping command]],  you need to XML entity encode each ampersand (&amp;). For example, to map the command </span><span class="f_Monospace">set &amp;foo = %i</span><span class="f_Notes">, you specify it like this: </span>
'''Note:''' To set a macro variable or macro function in a Client [[Setting up the ui.xml file#To set up a ui.xml file:|mapping command]],  you need to XML entity encode each ampersand (&amp;). For example, to map the command </span><span class="f_Monospace">set &amp;foo = %i</span><span class="f_Notes">, you specify it like this: </span>


<span class="f_CodeExList" style="font-size: 12px;">&lt;mapping command</span><span class="f_=XmpPrint" style="font-size: 12px;">=</span><span class="f_CodeExList" style="font-size: 12px;">&quot;set &amp;amp;foo </span><span class="f_=XmpPrint" style="font-size: 12px;">=</span><span class="f_CodeExList" style="font-size: 12px;"> %i&quot; button</span><span class="f_=XmpPrint" style="font-size: 12px;">=</span><span class="f_CodeExList" style="font-size: 12px;">&quot;button14&quot;/&gt; </span>
<p class="syntax"><span class="f_CodeExList" style="font-size: 12px;">&lt;mapping command</span><span class="f_=XmpPrint" style="font-size: 12px;">=</span><span class="f_CodeExList" style="font-size: 12px;">&quot;set &amp;amp;foo </span><span class="f_=XmpPrint" style="font-size: 12px;">=</span><span class="f_CodeExList" style="font-size: 12px;"> %i&quot; button</span><span class="f_=XmpPrint" style="font-size: 12px;">=</span><span class="f_CodeExList" style="font-size: 12px;">&quot;button14&quot;/&gt; </span></p>
|-
|-
| '''Client menu:'''
| '''Client menu:'''

Latest revision as of 18:37, 9 February 2023

Action:

Lets you create and initialize macro variables. Variable names begin with a single ampersand (&), and variable values include constants, User Language variables, fields, and $list elements, and other macro variables and functions.

Syntax:

set &target= string|[-]n|&var|%xxx|g.xxx|g.'xxx'|f.xxx      |$listcnt(x)|$listinf(x,y)      |&&function[(args)]

where:

  • &target is the macro variable being set.
  • string is a quoted string constant (double or single quotes).
  • [-]n is an integer constant with an optional leading minus sign.
  • &var is a previously defined macro variable.
  • %xxx is a mainframe variable.  
  • g.xxx or g.'xxx' is a global variable reference.
  • f.xxx is a field reference, possibly with a subscript.
  • $listcnt/$listinf are the Debugger functions for viewing $list counts and elements.
  • &&function is a macro function.

Note: To set a macro variable or macro function in a Client mapping command,  you need to XML entity encode each ampersand (&). For example, to map the command set &foo = %i, you specify it like this:

<mapping command="set &amp;foo = %i" button="button14"/>

Client menu: --
Introduced: Build 28