Scripting > mrScriptMetadata User's Guide > mrScriptMetadata reference > Field definitions > Compound
 
Compound
The compound type is used to create a compound question, which groups categorical questions and categorical loops that share the same category list.
Syntax
For clarity, each item is shown on a separate line, and optional items are indented, See also Syntax conventions.
field_name
  [ "field_label" ]
  [ [ <properties> ] ]
  [ <styles and templates> ]
compound
<categories>
fields( <field> (; <field> )* [;] )
  [ row | column ]
Parameters
field_name, field_label
See Names and labels for more information.
<properties>
You can define custom properties for your field to store information that is not directly supported by the Metadata Model (MDM). See Custom properties for more information.
<styles and templates>
You can use styles and templates to define the appearance of a question. See Styles and templates for more information.
<categories>
Defines the shared category list. You define it in the same way as the category list for a Categorical question.
<field>
Defines a question inside the compound question. This is restricted to a Categorical or a Categorical loop. If the question is a categorical, its category list must be omitted, because the compound's shared category list will be used instead. If the question is a categorical loop, its controlling category list must be omitted, because the compound's shared category list will be used instead. In addition, the expand and grid keywords must be specified for the categorical loop.
row
Specifies that nested compound questions are displayed as rows.
column
Specifies that nested compound questions are displayed as columns. This is the default behavior if neither the row nor column keywords are specified.
Remarks
For more information about writing Compound questions in interview scripts, see Printing categorical items side by side.
Example
The following example, which is from the Museum sample questionnaire, defines a compound question that contains one categorical question and two categorical loops, one of which defines a numeric grid question and the other a categorical grid question.
GalleryList define {
Dinosaur,
Conservation,
Fish "Fish and reptiles",
Fossils,
Birds,
Insects,
Whales,
Mammals,
Minerals,
Ecology,
Botany,
Origin "Origin of Species",
Human "Human biology",
Evolution,
Wildlife "Wildlife in danger"
};

RatingList define {
Not "Not at all interested",
NotParticularly "Not particularly interested",
NoOpinion "No opinion",
Slightly "Slightly interested",
Very "Very interested"
};

Plans compound { use GalleryList }
fields (
Plnview "What do you plan to see today?" categorical;

Plnord "What do you plan to see first, second, third, and so on?" loop
fields (
Order "Order of viewing" long [1 .. 16];
) expand grid;

Ratent "How interested are you in the following museum displays?" loop
fields (
Rating categorical [1] { RatingList use \\.RatingList };
) expand grid;
);
The following illustration shows the compound question, although its exact appearance depends on the formatting options chosen and the mode of interviewing.
See
Field definitions