string Property List: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Macros:string property list moved to String Property List: Moved to main namespace.)
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A string property list is a delimited string containing multiple key-value pairs in the format "var1=value1; var2=value2;..."
A string property list is a delimited string containing multiple key-value pairs in the format {{code|"var1{{=}}value1; var2{{=}}value2;..."}}


For example:
For example:


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: stringPropertyList="var1=foo; var2=bar; var3=baz;"]
[h: stringPropertyList="var1=foo; var2=bar; var3=baz;"]
</source>
</syntaxhighlight>


String property lists are zero-based (''i.e.'', the first item in a string property list is item 0). When a key-value pair is extracted from a string property list using one of the available [[Macros:Functions:list_of_functions_by_area#String_Properties | string property functions]], the value of the pair is considered a string, and must be converted to or evaluated to a number to perform numeric computations.
String property lists are zero-based (''i.e.'', the first item in a string property list is item {{code|0}}). When a key-value pair is extracted from a string property list using one of the available [[:Category:String Function|String Functions]] that work with string property lists, the value of the pair is considered a string, and must be converted to or evaluated to a number to perform numeric computations.


The default delimiter in a string property list is the semicolon (";"), however, the string property functions permit the use of alternate delimiters.  
The default delimiter in a string property list is the semicolon ({{code|";"}}), however, the [[:Category:String Function|String Functions]] that work with string property lists permit the use of alternate delimiters.  


String property lists may be stored in [[Token:token_property | token properties]].
Most [[:Category:String Property List Function|String Property List Functions]] only work with the default delimiter.
 
String property lists may be stored in a [[Token Property|token property]].
 
== See Also ==
* [[:Category:String_Property_List_Function|String Property List functions]]
 
[[Category:Variable Type]]

Latest revision as of 17:37, 14 March 2023

A string property list is a delimited string containing multiple key-value pairs in the format "var1=value1; var2=value2;..."

For example:

[h: stringPropertyList="var1=foo; var2=bar; var3=baz;"]

String property lists are zero-based (i.e., the first item in a string property list is item 0). When a key-value pair is extracted from a string property list using one of the available String Functions that work with string property lists, the value of the pair is considered a string, and must be converted to or evaluated to a number to perform numeric computations.

The default delimiter in a string property list is the semicolon (";"), however, the String Functions that work with string property lists permit the use of alternate delimiters.

Most String Property List Functions only work with the default delimiter.

String property lists may be stored in a token property.

See Also