This is an old revision of the document!
Statement | ForEach Bag |
---|---|
Version | 2.2.1+ |
Purpose | Causes a loop to be run through for each value in a particular bag |
The ForEach Bag statement requires a bag name and a loop variable name, in the format
ForEach Bag <bag name> <loop variable name>
On each pass through the loop, the loop variable will contain the next value from the bag, in the order they were added.
All ForEach Bag statements must be followed by an EndFor statement
The following example loops through everything stored in the 'recipients' bag
ForEach Bag recipients ThisRcpt Log "${ThisRcpt}" EndFor #There should be a separate entry in the log file for each value in the bag