Professional > Interview scripting > Writing interview scripts > Shared lists > Subheadings with shared lists > Subheadings in a shared list
 
Subheadings in a shared list
The rules for defining subheadings inside a shared list are similar to those for placing subheadings in response lists. To add subheadings to a shared list, place the following statement in the metadata section of the questionnaire:
Syntax
name define
{

  SubheadName1 ["Text1"]
  {
    response definitions
  },
  SubheadName2 ["Text2"]
  {
  response definitions
  }
  ...
}
Parameters
SubheadName1 and SubheadName2
The names of the subheadings.
Text1 and Text2
The texts for the subheadings. If the texts are the same as the names and do not contain spaces or other non-alphanumeric characters you may omit them and the interviewing program will display the subheading names instead.
response definitions
Either a list of response names and texts, or one or more use statements naming shared lists to be included in this list.
Example
Like "Which flavors of yogurt do you like?" categorical [1..]
{
Alpine
{
use AlpineList namespace
},
DairyFresh "Dairy Fresh"
{
use DairyFreshList namespace
}
};
might produce the following list:
When you use subheadings in this way, the subheadings divide the list into separate functional sections, so that the responses in each section can be referenced as a group using the subheading name. For example, in the routing section, you can filter on one sublist by typing, say, Responses.Alpine.Filter = {mango} to select mango flavored Alpine yogurt. However, subheadings do not make the response names unique so you cannot have two responses with identical names in the list. In the example shown here, Alpine and Dairy Fresh each produce different flavors of yogurt. If you want to generate this sort of display and have the same responses appearing under each subheading you must use namespacing as shown in When the same response appears in more than one list.
If you sort a shared list that contains subheadings, the subsections (Alpine and Dairy Fresh in this example) are reordered but the responses inside each subsection remain in their original places relative to the subheadings.
See also
Subheadings with shared lists