Desktop User Guides > Professional > Interview scripting > Interview scripting: Getting started > Writing repeated questions
 
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 and will be displayed as follows when you run an interview:
This graphic is described in the surrounding text.
Procedure
1 Enter the loop question. This loop will ask the WhereProduced categorical question for each tea in the TeaList shared list. Each question will have the response list of countries that is defined within 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 rather than hierarchical format.
The structure of this definition is more complex than that of the other definitions you have typed so far. Notice the different bracketing mechanisms: 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
Changing the order of responses in a list
See also
Interview scripting: Getting started