Parse (MPI)
From Tapestries MUCK
Line 1: | Line 1: | ||
- | [[Category: | + | [[Category:functions (MPI)]][[Category:Looping Functions (MPI)]] |
=parse= | =parse= | ||
<mpi>{parse:var,list,expr} | <mpi>{parse:var,list,expr} |
Revision as of 01:41, 31 March 2007
parse
{parse:var,list,expr} {parse:var,list,expr,sep} {parse:var,list,expr,sep,s2}
This evaluates expr for each and every item in the given list.
On each evaluation, the temporary variable var will contain the value of the item under scrutiny. This function returns a list containing the output of expr for each item within the list. This lets you do direct translation of a list of dbrefs, for example: into a list of names. var will only be defined for the duration of expr, and will be undefined after the {filter} construct finishes.
If sep is given, then it uses that string as the item seperator in the input list, instead of the usual carriage return character. If s2 is defined, then it will use that string to seperate the items in the list it returns, instead of the normal carriage return.
sep and s2 can be multiple characters long.