• <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
      • Numeric Values
      • String Values
      • 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
        • 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
        • JSON Representation
        • JavaScript Representation
      • Map Object
      • Path
      • Pff Object
      • StringWriter 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
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

CSPro ⇄ JSON Conversions: List Object

A CSPro List is represented as a one-dimensional JSON array. The underlying values of the List are serialized according to the JSON serialization rules for numeric values or string values.
When converting a JSON value to a List, an exception occurs if the value is not an array or if any of the array elements cannot be converted to a CSPro number or string. An exception also occurs if the array is multi-dimensional, unless the secondary dimension contains an array with a single value. That is, both [ 1, 2, 3 ] and [ [1], [2], [3] ] result in successful conversions.
Example 1
List values = 1.23, refused, 0, 9;

values.
getJson() // returns:
{
 
"name": "values",
 
"type": "List",
 
"contentType": "numeric",
 
"value": [
   
1.23,
   
"REFUSED",
   
0.0,
   
9.0
  ]
}
Example 2
List string values = "Washer", "Dryer";

values.
getValueJson() // returns:
[
 
"Washer",
 
"Dryer"
]
See also: JSON Representation of Symbols Overview, CSPro ⇄ JavaScript Conversions: List Object