Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Repeated questions > Asking repeated questions
 
Asking repeated questions
As a grid
To present a set of repeated questions as a grid, use this command in the routing section of the interview script as for an ordinary question:
<loop_name>.Ask()
This is the default if you do not specify a format.
The interviewing program displays the questions side by side in tabular form, using the values in the loop control list as the rows of the grid and the repeated questions as the columns.
If the set of repeated questions contains a compound item or is nested, the compound and/or nested items are ignored.
As a set of repetition pages
To display each repetition on a separate page, use this command in the routing section:
<loop_name>[..].Ask()
[..] means “for each item in the loop control list”; it tells the interviewing program to step through each value in the loop control list one at a time. The rest of the statement says “display the question”.
Each question on a separate page
If a loop contains more than one question, [..] displays all questions for a repetition on the same page. To display each question on a separate page, put these statements in the routing section:
Dim <variable_name>
For Each <variable_name> In <loop_name>
  <variable_name>.<question_name_1>.Ask() ...
  <variable_name>.<question_name_n>.Ask()
Next
Parameters
<variable_name>
A name to identify the variable. It is used to point to each question in the loop in turn.
<loop_name>
The name of the loop containing the repeated questions.
<question_name_1> to <question_name_n>
The names of the questions in the loop.
Example
Dim thisq For Each thisq In YearLoop thisq.CarInsuranceCost.Ask() thisq.CarHowPaid.Ask() Next
Because each question is asked using a separate Ask statement, the interviewing program will present them on separate pages.
Asking selected repetitions only
You do not have to repeat loop questions for all iterations of the loop. To ask the questions for a particular repetition only, use this command in the routing section:
<loop_name>[<repetition>].Ask()
For categorical loops, you can also use:
<loop_name>.<category>.Ask()
Parameters
<loop_name>
The name of the loop.
<repetition>
The repetition for which the question is to be asked. In a numeric loop, this is a numeric value from the range expression. In a categorical loop, this is a category text enclosed in braces; for example BrandLoop[{Brand1}].Ask().
<category>
The category name; for example, BrandLoop.Brand1.Ask().
For more information about filtering loops see Filtering loops.
See also
Repeated questions