• <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
        • ValueSet Statement
        • ValueSet.add Function
        • ValueSet.remove Function
        • ValueSet.clear Function
        • ValueSet.length Function
        • ValueSet.randomize Function
        • ValueSet.show Function
        • ValueSet.sort Function
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • 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>

ValueSet Statement

Format
ValueSet ʃvalueset_typeʅ valueset_name;
Description
The ValueSet statement creates a dynamic value set with the name valueset_name. The ValueSet name must be unique and must contain only letters, numbers, or the underscore character. The name must begin with a letter. You can declare ValueSet objects globally in PROC GLOBAL or locally in functions or procedures.
ValueSet objects can be numeric or string. By default a value set is numeric, but the type can be modified by specifying the valueset_type. When associating a value set with an item using setvalueset, the type must match the item type (numeric for numeric items, and string for alphanumeric items).
Variable Modifiers
The following variable modifiers apply to ValueSet objects:
  • persistent: to persist the variable's value from one run of an application to another.
Example
PROC MENU

onfocus

   
ValueSet menu_valueset;

   
// interviewer options
    if USER_ROLE = 1 then
        menu_valueset.
add("Add New Household", 1);
        menu_valueset.
add("View Existing Households", 2);

   
// supervisor options
    else
        menu_valueset.
add("View Household Report", 3);

   
endif;

    menu_valueset.
add("Quit", 99);

   
setvalueset(MENU, menu_valueset);
See also: ValueSet Object, List Object