getState: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Macros:Functions:getState moved to getState: Moving out of the Macros namespace.)
m (Added MacroFunction template and Token Function category)
Line 1: Line 1:
==Function getState==
{{MacroFunction
|name=getState
|description=
Returns 1 if the specified [[Token:state|Token State]] is set on the [[Token:Current Token|Current Token]] otherwise it returns 0.
Returns 1 if the specified [[Token:state|Token State]] is set on the [[Token:Current Token|Current Token]] otherwise it returns 0.


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: isSet = getState(name)]
[h: isSet = getState(name)]
</source>
</source>


===Examples===
|examples=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]
[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]
</source>
</source>
}}
[[Category:Token Function]]

Revision as of 03:59, 8 March 2009

getState() Function

Returns 1 if the specified Token State is set on the Current Token otherwise it returns 0.

Usage

[h: isSet = getState(name)]

Examples

[if(getState("Dead"), "You are dead!", "You are not dead (yet!)")]