strPropFromVars: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 26: Line 26:
</source>
</source>
(returns "c=cow ; a=3 ; b=bob ; "):
(returns "c=cow ; a=3 ; b=bob ; "):
}}
 
|changes=
|changes=
{{change|1.5.4|Made {{code|varStyle}} optional.}}
{{change|1.5.4|Made {{code|varStyle}} optional.}}


}}
[[Category:String Property List Function]]
[[Category:String Property List Function]]

Revision as of 20:37, 14 August 2019

strPropFromVars() Function

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

Usage

[h: strPropFromVars(varList) ]
[h: strPropFromVars(varList, varStyle) ]
[h: strPropFromVars(varList, varStyle, delim) ]

Parameters

  • varList - A list of variable names, separated by ",".
  • varStyle - Either "SUFFIXED" or "UNSUFFIXED". The "SUFFIXED" option will look for variables with underscores appended to the given names. Defaults to "UNSUFFIXED".
  • delim - The delimiter for the return string. Defaults to ";".

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 ; "):

Version Changes

  • 1.5.4 - Made varStyle optional.