Format 1:
set attributes (field-1[, field-2, ..., field-N])
display | visible | autoskip | return | protect | hidden | native;
Format 2:
set attributes(field-1[, field-2, ..., field-N])
assisted on|off [(question, responses)];
[ ] indicates that this part is optional
| indicates that one of the attributes may be selected
Description of Format 1:
This set attributes statement switches the values of various field properties. Field properties can be set statically, via the field properties dialog box, or dynamically at run time via the set attributes command. A dynamically set field property will override any statically set property. Field properties can be set dynamically anywhere in the program except in the PROC GLOBAL section.
One or more dictionary items can be named in the field list. If the dictionary name is used, all the fields in the dictionary are affected. If a form name is used, all the fields on the form are affected.
In Format 1, only one attribute setting can be used in any single set attributes statement. The options are as follows:
visible |
If a field is hidden, its value will now be visible; if it was already visible, the setting has no effect
|
autoskip |
This is equivalent to leaving the statically-set field property "Use Enter Key" unchecked. If this option is used, the cursor automatically advances to the next field, after the maximum number of characters have been entered. This option will override any statically-set field property settings.
|
return |
This is equivalent to checking the statically-set field property "Use Enter Key." If this option is used, the operator must press the <Enter> key to advance from the listed field(s). This option will override any statically-set field property settings.
|
protect |
This is identical to the statically-set field property "protected." If a field is set to 'protect', the operator will not be able to enter it. If the field was already statically set to "protected," the setting has no effect.
|
hidden |
If a field is visible, its value will now be hidden from view; if it was already hidden, the setting has no effect.
|
native |
Regardless of what settings have been made dynamically in the program, if a field is set to native, all field settings will revert to their initial, statically-set properties. |
Example of Format 1:
set attributes (total_HH_income) protect;
Description of Format 2:
The set attributes statement with the assisted keyword switches on or off a popup responses box during data entry. The values in the responses box come from the first value set in the data dictionary for that field. The user can either select a response or type a response. This behavior is true in any CSPro data entry application.
One or more dictionary items can be named in the field list. If the dictionary name is used, all the fields in the dictionary are affected. If a form name is used, all the fields on the form are affected.
By default, the responses are taken from the first value set of the item. You can modify the values and responses using the function setvalueset.
Description of Format 2 in CAPI applications
This statement has further meaning in CAPI data entry applications. Note that when you create a CAPI data entry application, the question text for each item is automatically shown during data entry, but NOT the responses box. There are two ways to make the responses box appear (or disappear):
1. Use this statement in the application's logic. For example:
set attributes(MYDICT) assisted on;
set attributes(MYDICT) assisted off;
set attributes(REL, SEX, EDUC) assisted on;
2. Have the operator turn the response box on and off:
To show or hide responses for this field, press Ctrl+C or from the Options menu, select Show Responses (This Field).
To show or hide responses for all fields, press Ctrl+K or from the Options menu, select Show Responses (All Fields).
The operator can also move the response box around on the screen using the mouse.
Use the following forms of this command to get the desired behavior in your program logic for CAPI applications:
// show both questions and responses
set attributes(MYDICT) assisted on;
set attributes(MYDICT) assisted on (question, responses);
// show question text but not responses
set attributes(MYDICT) assisted on (question);
< no set attributes command >
// show responses but not question text
set attributes(MYDICT) assisted on (responses);
See also: Change Field Properties, Change Data Entry Options, Introduction to CAPI