Home
About
Policies
FAQ
Forums
Registration
Password Recovery

Foreach (MPI)

From Tapestries MUCK

Jump to: navigation, search

foreach

{foreach:var,list,expr}
{foreach:var,list,expr,sep}

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.

var will only be defined for the duration of expr, and will be undefined after the {foreach} construct finishes. If sep is given, then it uses that string as the item seperator in list, instead of the usual carriage return character.

sep can be multiple characters long.

This structure returns the result of the last evaluation of expr.

Example:

{foreach:thing,{contents:here},{tell:{name:{&thing}}}}

This will display the name of every object in the room, then it will return the name of the last object it displayed.

Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox