setMacroCommand: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function setMacroCommand== {{TrustedOnlyFunction}} Sets the command that will be run when the Token:Macro Button is pressed. Note because of the way the parser interprets values w...)
 
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function setMacroCommand==
{{MacroFunction
{{TrustedOnlyFunction}}
|name=setMacroCommand
 
|trusted=true
|description
Sets the command that will be run when the [[Token:Macro Button|Macro Button]] is pressed.  Note because of the way the parser interprets values within [] you may have to use the [[Macros:Functions:encode| encode()]] and [[Macros:Functions:decode|decode()]] functions with the string.
Sets the command that will be run when the [[Token:Macro Button|Macro Button]] is pressed.  Note because of the way the parser interprets values within [] you may have to use the [[Macros:Functions:encode| encode()]] and [[Macros:Functions:decode|decode()]] functions with the string.


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: setMacroCommand(buttonIndex, command)]
[h: setMacroCommand(buttonIndex, command)]
</source>
</source>


===Examples===
|examples=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: setMacroCommand(1, "[macro('Test@Lib:Test'): '']")]
[h: setMacroCommand(1, "[macro('Test@Lib:Test'): '']")]
</source>
</source>
}}
[[Category:Metamacro Function]]

Revision as of 04:17, 9 March 2009

setMacroCommand() Function

 Note: This function can only be used in a Trusted Macro

Usage

[h: setMacroCommand(buttonIndex, command)]

Examples

[h: setMacroCommand(1, "[macro('Test@Lib:Test'): '']")]