Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Commas (MPI)

From Tapestries MUCK

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
-
[[Category:MPI functions]][[Category:MPI List Handling Functions]]
+
[[Category:functions (MPI)]][[Category:List Handling Functions (MPI)]]
=commas=
=commas=
<mpi>{commas:list}
<mpi>{commas:list}

Latest revision as of 01:36, 31 March 2007

commas

{commas:list}
{commas:list,lastsep}
{commas:list,lastsep,var,expr}

Takes a list and returns a plain english comma delimited string with the items in it. For example,

{commas:{mklist:Tom,Dick,Harry}}
will return:

"Tom, Dick and Harry"

If you specify the lastsep argument, you can replace the "and" with something else, such as "or" to get a result like "a, b or c". Note: You need to be careful to include spaces around the "or" or else you might get a result like "a, borc". Example:

{commas:{mklist:a,b,c}, or }

If the var and expr arguments are passed, then for every item in the list, it will set the value of the given variable name (which it will declare) to the item, then evaluate expr, and use the result in the string it outputs. Example:

{commas:{contents:here},\, or ,v,{name:{&v}}}

will return the name of every object in the room in a comma separated list, using ", or " as the final conjunction ie: "Tom, Can of SPAM, Dick, or Harry."

Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox