Writing repeated questions
When one or more questions are to be asked more than once, you define them inside a loop. Depending on the number and type of questions inside the loop, you will either see one page of questions for each repetition, or you will see a tabular display for all repetitions together, which is called a grid.
In this example, the loop contains one categorical question, like this:
Procedure
1 Enter the loop question. This loop asks the WhereProduced categorical question for each tea in the TeaList shared list. Each question has the response list of countries that is defined in the loop.
WhereProducedLoop "Which country or countries produces ...?" loop
{
use TeaList
} fields
(
WhereProduced categorical [1..]
{
China,
India,
Japan,
Kenya,
SouthAfrica "South Africa",
SriLanka "Sri Lanka"
};
)
expand;
The expand keyword at the end of the definition tells the interviewing program to write the data in a flat format instead of hierarchical format.
The structure of this definition is more complex than that of the other definitions you have typed so far. Different bracketing mechanisms are used: braces for shared lists and response lists, and ordinary parentheses for the fields definition as a whole.
Requirements
UNICOM Intelligence Professional with Interview Scripting.
Next
See also