• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
      • Introduction to CSPro Language
      • Data Requirements
      • CSPro Program Structure
      • Programming Standards
      • Code Folding
      • Debugging CSPro Applications
      • Declaration Section
        • Compiler Mode
        • Variables
        • Alias Statement
        • User-Defined Functions
        • Array Object
        • Audio Object
        • Case Object
        • Document Object
        • File Object
        • Freq Object
        • Geometry Object
        • HashMap Object
        • Image Object
        • List Object
        • Map Object
        • Pff Object
        • SystemApp Object
        • ValueSet Object
      • Procedural Sections
      • Logic
      • Language Elements
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and 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>

Array Object

In logic, an Array is an object that contains a collection of elements of the same type, either numeric, alphanumeric, or string. An array can be of many dimensions, though each of these dimensions is of a fixed size. Arrays can be used in various processing operations, including defining a list of constant values (like month names) or working with hotdecks and DeckArrays.
Whenever an Array object is used in the application, a value or numeric expression for each dimension must be given. The initial array contents are zero (if numeric) and blank (if alphanumeric or string) until a value for each dimension is assigned. If using a numeric saved array, the initial array contents are default.
If you want the behavior of an array but without fixed dimensions, you can use the HashMap object, which is an associative array.
Functionality
An Array is a CSPro logic object and the following functions can be called via dot notation:
FunctionDescription
clearResets all array values to the default value.
lengthReturns the size of an array dimension.
 
getLabelReturns the symbol's label.
getNameReturns the symbol's name.
getJsonReturns the symbol's metadata and value represented in JSON.
getValueJsonReturns the symbol's value represented in JSON.
updateValueFromJsonModifies the symbol based on a JSON representation of the value.
Assignments
When an Array is used as an argument to a user-defined function, it is passed by reference.
See also: HashMap Object, List Object