Professional > Interview scripting > Writing interview scripts > Shared lists > Creating shared lists
 
Creating shared lists
To create a shared list, place the following statement in the metadata section of the questionnaire:
Syntax
Name define
{
  ResponseName1 [ResponseText1],
  ResponseName2 [ResponseText2], ...
  ResponseNamen [ResponseTextn]
};
You can define lists at any point in the questionnaire, but if you are using UNICOM Intelligence Professional the lists will always be moved to the top of the metadata section when you close and reopen the questionnaire. In the Metadata Explorer pane of UNICOM Intelligence Professional, response lists are shown under Types.
If you define a shared list inside a block or a loop it is visible only in that block or loop. If a question outside the block of loop uses the shared list, the question will be displayed without a response list. If you create a shared list inside a block or loop and give it the same name as a shared list that already exists in the parent script, the shared list within the block or loop takes precedence over the one in the parent script.
Parameters
Name
The name of the list. Try to make the list name reflect its contents as this will make the rest of the questionnaire script easier to understand.
ResponseName1 to ResponseNamen
The response names. These must consist of a letter followed by letters and numbers only. It is a good idea to make the response name the same as the response text if you can so that you can omit the response text.
ResponseText1 to ResponseTextn
The response texts. If a response text does not contain spaces, punctuation, or other non-alphanumeric characters you may omit it and the interviewing program will use the response name as the response text.
Example
Here is a shared list naming different brands of a product:
BrandList define {
  Alpine,
  Finborough,
  Alsace,
  DairyFresh "Dairy Fresh"
};
The Dairy Fresh response has a name and a text because the response text contains spaces.
This example lists each response on a separate line and indented, but you may place several responses on the same line if you prefer. Note, however, that when you close and reopen the file, UNICOM Intelligence Professional will reapply its default layout which is to place each response on a separate line.
See also
Shared lists