• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
        • List Statement
        • List.Add Function
        • List.Insert Function
        • List.Seek Function
        • List.Remove Function
        • List.RemoveDuplicates Function
        • List.RemoveIn Function
        • List.Clear Function
        • List.Length Function
        • List.Show Function
        • List.Sort Function
      • Map Object
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • 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
      • Export Attributes
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

List Statement

Format
list ʃlist_typeʅ list_name;
Description
The list statement creates a list with the name list_name. The list name must be unique and must contain only letters, numbers, or the underscore character. The name must begin with a letter. You can declare lists globally in PROC GLOBAL or locally in functions or procedures.
Lists can be numeric or string. By default a list is numeric, but the type can be modified by specifying the list_type.
The initial elements of a list can be set on definition by listing each value, separated by a comma. A list can also be initialized to the values of another list.
Example
// numeric lists
list DaysPerMonthTypical = 31, 28, 31, 30, 31, 30,
                           
31, 31, 30, 31, 30, 31;

list numeric DaysPerMonthLeapYears = DaysPerMonthTypical;
DaysPerMonthLeapYears(
2) = 29;

// string lists
list string MonthNames = "Jan", "Feb", "Mar", "Apr", "May", "Jun",
                         
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec";
See also: List Object, Array Object, HashMap Object, ValueSet Object