strPropFromVars: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function strPropFromVars== Creates a property string from the names and values of the variables listed in the varList string. ===Usage=== <source lang="mtmacro" line> [h: strPropFromVar...)
 
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function strPropFromVars==
{{MacroFunction
|name=strPropFromVars
|description=
Creates a property string from the names and values of the variables listed in the varList string.
Creates a property string from the names and values of the variables listed in the varList string.


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: strPropFromVars(varList, varStyle) ]
[h: strPropFromVars(varList, varStyle) ]
Line 8: Line 10:
* varStyle is either "SUFFIXED" or "UNSUFFIXED". When fetching the values of the variables, the "SUFFIXED" option will look for variables with underscores appended to the given names. The output property string does not contain the underscores.
* varStyle is either "SUFFIXED" or "UNSUFFIXED". When fetching the values of the variables, the "SUFFIXED" option will look for variables with underscores appended to the given names. The output property string does not contain the underscores.


===Examples===
|examples=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[H: props = "a=3 ; b=bob ; c=cow ; "]
[H: props = "a=3 ; b=bob ; c=cow ; "]
Line 15: Line 17:
</source>
</source>
(returns "c=cow ; a=3 ; b=bob ; "):
(returns "c=cow ; a=3 ; b=bob ; "):
}}
[[Category:String Property List Function]]

Revision as of 05:22, 9 March 2009

strPropFromVars() Function

Creates a property string from the names and values of the variables listed in the varList string.

Usage

[h: strPropFromVars(varList, varStyle) ]
  • varStyle is either "SUFFIXED" or "UNSUFFIXED". When fetching the values of the variables, the "SUFFIXED" option will look for variables with underscores appended to the given names. The output property string does not contain the underscores.

Examples

[H: props = "a=3 ; b=bob ; c=cow ; "]
[H: varsFromStrProp(props, "SUFFIXED")] <!-- creates variables a_, b_, c_ -->
[strPropFromVars("c,a,b", "SUFFIXED")]
(returns "c=cow ; a=3 ; b=bob ; "):