To allow the nesting of for each child loop statements, a string variable must be associated with the loop. ESL sets the specified string variable with the name (identifier) of the child object. The identifier, which contains the full ancestry of the child object, can then be used with action statements or built-in functions. Using recursive calls to subroutines, it is possible to access all objects within a parent, which is useful when complex compound windows are used.
For example:
subroutine SaveValues(string: Parent) is
string Child
Text
for each child Child of Parent loop
if (type of Child = “entry field”) then #look for entry fields
copy text of Child to Text #save the text of the
make Child parameter Text #field in the parameter
else
call SaveValues(Child) #check for grand children
end if
end loop
The loop progresses through the child objects defined within the parent object in the order they were added or defined.