Subheadings using “sublist”
If you have shared lists that you load into questions with use, you can use the sublist keyword to mark lists whose responses are to be treated as a single group or sublist within the response list as a whole:
Syntax
<question_name> "<question_text>" categorical [<number_of_responses>]
{
use <list_1> sublist ["<subheading_1>"],
...
use <list_n> sublist ["<subheading_n>"]
};
Parameters
<question_name>
The question name.
<list_1> to <list_n>
The names of the shared lists you want to include in the question’s response list.
<subheading_1> to <subheading_n>
Optional subheadings to be displayed above the shared lists.
Example
BrandList define
{
Alpine,
Finborough,
Alsace,
DairyFresh "Dairy Fresh"
};
OrganicBrands define
{
HelenBradley "Helen Bradley's",
KentishFarm "Kentish Farm",
NaturesWay "Nature's Way Organic"
};
TVAds "Which brands of yogurt have you see advertised
on TV?" categorical [1..]
{
use BrandList sublist "Non-organic brands",
use OrganicBrands sublist "Organic brands"
};
Notes
If you use a shared list as a sublist for a number of questions and you always want to use the same subheading text, you can include the subheading text as part of the list’s definition and omit it from the individual uses. The list’s definition becomes:
<question_name> "
<subheading_text>
" define
{
<response_name_1> [<response_text_1>],
<response_name_2> [<response_text_2>],
...
<response_name_n> [<response_text_n>]
};
You can rewrite the previous example as follows and still achieve the same page layout as in the illustration.
NonOrgYogs "Non-organic brands" define
{
Alpine,
Finborough,
Alsace,
DairyFresh "Dairy Fresh"
};
OrgYogs "Organic brands" define
{
HelenBradley "Helen Bradley's",
KentishFarm "Kentish Farm",
NaturesWay "Nature's Way Organic"
};
PrintedAds "Which brands of yogurt have you seen
advertised in magazines or newspapers?" categorical [1..]
{
use NonOrgYogs sublist,
use OrgYogs sublist
};
If a shared list is defined with one subheading text and is then used as a sublist with a different subheading, the subheading defined with sublist overrides the subheading defined in the define statement. If a shared list is defined with an integral subheading and you want to use the list without a subheading, just enter a null text (two consecutive double quotation marks) after the sublist keyword for that list. For example:
RadioAds "Which brands of yogurt have you heard
advertised on the radio?" categorical [1..]
{
use NonOrgYogs sublist "",
use OrgYogs sublist ""
};
to display the lists of yogurt brands without their subheadings.
See also