getPropertyNamesRaw: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{stub|Everything !}}{{MacroFunction |name=getPropertyNamesRaw |version=1.3b64  
{{stub|Everything !}}{{MacroFunction |name=getPropertyNamesRaw |version=1.3b64  
|description= This function returns all the defined properties defined on a token. Be it hidden or not.
|description=
Returns a [[String List]] or [[JSON Array]] containing the names of the [[Token Property|Token Properties]] on a [[Token]]. The type of the value returned depends on the delimiter parameter. The difference between this function and getPropertyNames() is that this function returns only the defined properties, where getPropertyNames returns also the names of the properties of the Property Type, even if these are not defined or set to their default value.


|usage= To be done. |example= None. |also= [[getPropertyNames]] }}[[Category:Token Function]]
|usage=
<source lang="mtmacro" line>
getPropertyNamesRaw()
</source>
<source lang="mtmacro" line>
getPropertyNamesRaw(delim)
</source>
<source lang="mtmacro" line>
getPropertyNamesRas(delim, id)
</source>
'''Parameters'''
{{param|delim|The delimiter used to separate the values in the [[String List]], defaults to {{code|","}}. Returns a [[JSON Array]] if set to {{code|"json"}}. }}
{{param|id|The token {{code|id}} of the token which has its property names returned, defaults to the [[Current Token]]. {{TrustedParameter}} }}
 
|example=
To display the names of all of the [[Token:property|properties]] on the current [[Token:token|token]] use.
<source lang="mtmacro" line>
[h: names = getPropertyNamesRaw()]
[foreach(name, names, "<br>"): name]
</source>
 
|changes=
 
 
[[Category:Token Function]]

Revision as of 19:24, 9 September 2011

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

{{MacroFunction |name=getPropertyNamesRaw |version=1.3b64

|description= Returns a String List or JSON Array containing the names of the Token Properties on a Token. The type of the value returned depends on the delimiter parameter. The difference between this function and getPropertyNames() is that this function returns only the defined properties, where getPropertyNames returns also the names of the properties of the Property Type, even if these are not defined or set to their default value.

|usage=

getPropertyNamesRaw()
getPropertyNamesRaw(delim)
getPropertyNamesRas(delim, id)

Parameters

  • delim - The delimiter used to separate the values in the String List, defaults to ",". Returns a JSON Array if set to "json".
  • id - The token id of the token which has its property names returned, defaults to the Current Token.

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

|example= To display the names of all of the properties on the current token use.

[h: names = getPropertyNamesRaw()]
[foreach(name, names, "<br>"): name]

|changes=