ARGS: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
:CALL "NewMacro.mac", MyNum, 2.53, "abc", MyVal | :CALL "NewMacro.mac", MyNum, 2.53, "abc", MyVal | ||
In the macro that is called ("NewMacro.mac")<br> | |||
:ARGS r1, e3, ab$, ResultVal | :ARGS r1, e3, ab$, ResultVal | ||
<br> | <br> | ||
In "NewMacro.mac": | |||
:r1 will be set to the value stored in the variable MyNum in the calling macro. | :r1 will be set to the value stored in the variable MyNum in the calling macro. | ||
:e3 will be set to 2.53 | :e3 will be set to 2.53 |
Revision as of 21:25, 29 July 2010
Command
- 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