Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Shared lists > Creating shared lists
 
Creating shared lists
To create a shared list, put the following statement in the metadata section of the questionnaire.
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.
Syntax
<list_name> define
{
  <response_name_1> [<response_text_1>],
  <response_name_2> [<response_text_2>], ...
  <response_name_n> [<response_text_3>]
};
Parameters
<list_name>
The name of the list. Use a name that reflects the contents of the list, to make the rest of the questionnaire script easier to understand.
<response_name_1> to <response_name_n>
The response names. They must consist of a letter followed by letters and numbers. Make the response name the same as the response text if you can, so that you can omit the response text.
<response_text_1> to <response_text_n>
The response texts. If a response text does not contain spaces, punctuation, or other non-alphanumeric characters, you can omit it and the interviewing program will use the response name as the response text.
Example
The following lists contains 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 can put several responses on the same line if you prefer. However, when you close and reopen the file, UNICOM Intelligence Professional reapplies its default layout which is to place each response on a separate line.
See also
Shared lists