LassoScript Utility
Basics Browse Detail


Tag Link [Array->ForEach] Category Array
Type Member Source Available No
Support Preferred Version 8.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0


[Array->ForEach] invokes a tag, type, or compound expression on each element in the array. The tag requires a single parameter which is a tag reference, data type instance, or compound expression. The parameter is invoked on each element of the array in turn (i.e. the tag is called with each element of the array as a parameter in turn). The parameter must return True for the tag to continue. If the parameter returns False then the operation is halted.

The parameter can modify the array by modifying the array element which is passed into it by reference.


[Var: 'array' = (Array: 1, 2, 3, 4)]
[Define_Tag: 'Ex_Square', -Required='value']
[#value *= #value]
[Return: True]
[$array->(ForEach: \Ex_Square)]


Required Parameters
Tag A tag reference, data type, or compound data type. This parameter will be applied to each element of the array in turn


See the Lasso 8 Language Guide for examples of how to use this tag.

Related Tags

Category Tags