ARGS

From Macros Wiki
Revision as of 21:51, 29 July 2010 by ConnerO (talk | contribs)
Jump to navigationJump to search

Command

AGRS
AGRS
ARGS <var name>, <var name>, <var name> (max 10 variables)


When you call another macro, you can optionally pass one ore move values to that macro. The ARGS command is used to define the names of variables that are local to the macro being called, to contain the values being passed.

Parameters

<var name>
Set the value of a number variable
<var name>
Set the value of a number variable
<var name>
Set the value of a number variable

Example

CALL "NewMacro.mac", MyNum, 2.53, "abc", MyVal

In the macro that is called ("NewMacro.mac")

ARGS r1, e3, ab$, ResultVal


In "NewMacro.mac":

r1 will be set to the value stored in the variable MyNum in the calling macro.
e3 will be set to 2.53
ab$ will be set to "abc"
ResultVal will be set to the value stored in the variable MyVal in the calling macro.


If you change the values in the variables r1 and/or ResultVal in the macro "NewMacro.mac"
these new values will be passed back to the calling macro and used to update the variables
MyNum and Myval.


For an example macro see Modify_op_path2 GlobalLocal_Sub.mac