• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
        • Accept Function
        • Advance Statement
        • Ask Statement
        • ChangeKeyboard Function
        • Connection Function
        • DeMode Function
        • Display Orientation
        • EditNote Function
        • EndLevel Statement
        • EndGroup Statement
        • Enter Statement
        • GetCaptureType Function
        • GetCaseLabel Function
        • GetDeviceID Function
        • GetImage Function
        • GetNote Function
        • GetOperatorId Function
        • GetOS Function
        • GetRecord Function
        • GetUserName Function
        • GPS Function
        • Interactive GPS Modes
        • HideOcc Function
        • Highlighted Function
        • InAdvance Function
        • IsPartial Function
        • IsVerified Function
        • Move Statement
        • NoInput Statement
        • OnChangeLanguage Global Function
        • OnChar Global Function
        • OnKey Global Function
        • OnStop Global Function
        • OnSystemMessage Global Function
        • Prompt Function
        • Protect Function
        • PutNote Function
        • RandomizeVS Function
        • Reenter Statement
        • SavePartial Function
        • SelCase Function
        • Set Attributes Statement
        • Set Behavior CanEnter Statement
        • SetCapturePos Function
        • SetCaptureType Function
        • SetCaseLabel Function
        • Set ErrMsg Statement
        • SetFont Function
        • SetOperatorId Function
        • Show Function
        • ShowArray Function
        • ShowOcc Function
        • Skip Statement
        • Userbar Function
        • VisualValue Function
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Set Attributes Statement

Feature Upgrade: Starting with CSPro 7.1, you should no longer use these functions as they may soon be removed from CSPro. To replicate the behavior of the functions, you can use the setproperty function with one of the following arguments: "CaptureType", "Protected", or "UseEnterKey".

 

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