getName: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added version, cleaned up formatting.)
m (Added id parameter and usage example.)
Line 4: Line 4:
|version=1.3b40
|version=1.3b40
|description=
|description=
Returns the name of the [[Current Token]].
Returns the name of a [[Token]].


|usage=
|usage=
Line 10: Line 10:
getName()
getName()
</source>
</source>
<source lang="mtmacro" line>
getName(id)
</source>
'''Parameters'''
{{param|id|The token {{code|id}} of the token to name, defaults to the [[Current Token]]. {{TrustedParameter}} }}
|example=
<source lang="mtmacro" line>
[TokenList = getTokens("json")]
[foreach(Token, TokenList, "<br>", "json"): getName(Token) + "'s ID is " + Token]
</source>
|changes=
{{change|1.3b51|Added {{code|id}} parameter option.}}


}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 18:24, 13 April 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

getName() Function

Introduced in version 1.3b40
Returns the name of a Token.

Usage

getName()
getName(id)

Parameters

  • id - The token id of the token to name, defaults to the Current Token.

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

Example

[TokenList = getTokens("json")]
[foreach(Token, TokenList, "<br>", "json"): getName(Token) + "'s ID is " + Token]


Version Changes

  • 1.3b51 - Added id parameter option.