The in condition, which is executed only once (after the loop variable has been declared) controls the iteration of the loop. Before each iteration, the loop variable is assigned successive values from the argument list. The argument list cannot be empty.
foreach variable in( argument list )do
expression list
Note:
Use a comma (,) to separate more than one simple expression in the argument list.
The value of the last expression list that was evaluated, or zero(0), if the loop was never entered.
foreach Item in (xfa.record.lists.list1.display[*]) do
$.addItem(Item,”")
endfor

Foreach expressions