Set command

From m204wiki
Jump to navigation Jump to search
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