getMacroButtonIndex: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (This function doesn't seem to work, and I can't find any documentation that says it ever actually made it into a build. Take off the proposed if I'm wrong about this.)
m (Removed proposed note, linkified some text, added see also.)
Line 1: Line 1:
{{stub}}
{{stub|Expanded examples of usage.}}
{{MacroFunction
{{MacroFunction
|name=getMacroButtonIndex
|name=getMacroButtonIndex
|proposed=true
|version=1.3b50
|version=1.3b50
|description=Returns the index of the macro button that was clicked on for the token. The macro button must have the auto execute check box selected. If the macro is not running from a token macro button then -1 is returned.
|description=
Returns the index of the [[Token]] macro button that was clicked on. The macro button must have the auto-execute check box selected. If the macro is not running from a [[Token]] macro button then {{code|-1}} is returned.


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: ind = getMacroButtonIndex()]
getMacroButtonIndex()
</source>
</source>


Line 15: Line 15:
[h: ind = getMacroButtonIndex()]
[h: ind = getMacroButtonIndex()]
</source>
</source>
If the macro is not run from an auto-execute macro button on a [[Token]], {{code|ind}} is set to {{code|-1}}. Otherwise {{code|ind}} is set to a non-negative number which is the index of the button.
|also=
{{func|getMacroIndexes}}


If the macro is not run from an auto execute macro button on a token it returns:
  -1
Otherwise it returns a non negative number which is the index of the button.
}}
}}
[[Category:Metamacro Function]]
[[Category:Metamacro Function]]

Revision as of 13:43, 6 April 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
 This article needs: Expanded examples of usage.

getMacroButtonIndex() Function

Introduced in version 1.3b50
Returns the index of the Token macro button that was clicked on. The macro button must have the auto-execute check box selected. If the macro is not running from a Token macro button then -1 is returned.

Usage

getMacroButtonIndex()

Example

[h: ind = getMacroButtonIndex()]
If the macro is not run from an auto-execute macro button on a Token, ind is set to -1. Otherwise ind is set to a non-negative number which is the index of the button.

See Also