getPropertyNames: Difference between revisions
Verisimilar (talk | contribs) (Applied Template:MacroFunction) |
Verisimilar (talk | contribs) mNo edit summary |
||
Line 5: | Line 5: | ||
The type of the value returned depends on the delimiter parameter. | The type of the value returned depends on the delimiter parameter. | ||
* If the delimiter is not specified then a [[Macros:string list|string list]] is returned with the default value of {{code|","}} is used. | * If the delimiter is not specified then a [[Macros:string list|string list]] is returned with the default value of {{code|","}} is used. | ||
* If the delimiter {{code|json}} then a [[Macros:json array|json array]] is returned. | * If the delimiter {{code|json}} then a [[Macros:json array|json array]] is returned. | ||
* Otherwise a [[Macros:string list|string list]] is returned with the delimiter passed in. | * Otherwise a [[Macros:string list|string list]] is returned with the delimiter passed in. | ||
Line 21: | Line 21: | ||
[foreach(name, names, "<br>"): name] | [foreach(name, names, "<br>"): name] | ||
</source> | </source> | ||
|changes= | |||
* '''1.3b49''' - Added {{code|json}} delimiter option. | |||
}} | }} | ||
===Notes=== | ===Notes=== | ||
When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the Edit Token window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. ''getPropertyNames()'' will return ''all'' token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (''i.e.'', they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use [[getAllPropertyNames|getAllPropertyNames()]]. | When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the Edit Token window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. ''getPropertyNames()'' will return ''all'' token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (''i.e.'', they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use [[getAllPropertyNames|getAllPropertyNames()]]. | ||
[[Category:Token Function]] | [[Category:Token Function]] |
Revision as of 03:34, 8 March 2009
getPropertyNames() Function
The type of the value returned depends on the delimiter parameter.
- If the delimiter is not specified then a string list is returned with the default value of
","
is used. - If the delimiter
json
then a json array is returned. - Otherwise a string list is returned with the delimiter passed in.
Usage
[h: names = getPropertyNames()]
[h: names = getPropertyNames(delim)]
delim
is the delimiter used to separate the values in the string list which defaults to ","
if not specified.
Example
[h: names = getPropertyNames()]
[foreach(name, names, "<br>"): name]
Version Changes
- 1.3b49 - Added
json
delimiter option.
Notes
When token properties are created during campaign, they are persistent in the MapTool campaign, regardless of whether they are editable in the Edit Token window. In other words, even though a property is removed from the campaign properties, it remains available in the MapTool code. getPropertyNames() will return all token properties that exist or have ever existed in the particular campaign, even if users cannot directly edit those properties (i.e., they do not appear in the token's properties when you double click on a token). To get only properties that are currently visible and editable, use getAllPropertyNames().