Retrieving Information Other Than Answers from a REPEAT Instruction
You can use a Computation variable to retrieve other information than a list of answers from a REPEAT instruction.
For example, perhaps you want to gather a list of children, and then find and return the number of children who are minors. You can use the REPEAT instruction in a computation to get the result you want. The following computation script shows an example of how to do this:
0
REPEAT Child Information
IF AGE( Birthdate ) < 18
RESULT + 1
END IF
END REPEAT
In this script, the REPEAT instruction iterates over the Child Information list, and the IF statement checks if the age of each child is less than 18. If the condition is true, the computation adds 1 to the RESULT variable. The final value of RESULT represents the number of children who are minors.