• <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>

Variables

Within CSPro logic, you can declare numeric and string variables, or the following objects:
  • Array
  • Audio
  • Case
  • Document
  • File
  • Freq
  • Geometry
  • HashMap
  • Image
  • List
  • Map
  • Pff
  • Report
  • SystemApp
  • ValueSet
Variable names can only contain letters, numbers, or the underscore (_) character, and they must begin with a letter. By default, names are case insensitive; that is, uppercase and lowercase letters are considered the same, meaning that variables named myvar, MYVAR, and MyVar are all equivalent.
Variables can be global or local in scope. If a variable is declared in the PROC GLOBAL block, then the variable has a global scope and can be referenced anywhere within your program. However, if a variable is declared at a lower level, such as the PROC for a form or block, then the variable is only accessible within that PROC.
Numeric Variables
In CSPro, numeric variables are stored internally in floating point format. They can accommodate numbers of extremely small or large size, positive or negative, as well as special values.
String Variables
Alphanumeric data can contain any combination of letters, digits, blanks, or other special characters. As no string size is required when declaring a string variable, there is no limit to the size of the string. This is an improvement over the alpha statement which cannot exceed 8,192 characters.
See also: Data Type, Dot Notation, Logic Objects, and Namespaces, String Literals