• <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 Statement
        • String Statement
        • Alpha Statement
        • config Variable Modifier
        • ensure Variable Modifier
        • persistent Variable Modifier
        • Visual Values for Numeric Fields
        • Relation Statement
        • Function Named Arguments
        • Function Statement
        • Optional Function Parameters
        • Passing Function Arguments by Reference
        • Additional Examples of User-Defined Functions
        • Dot Notation, Logic Objects, and Namespaces
      • 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
      • 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>

config Variable Modifier

Format
config variable_type variable1ʃ, ..., variableNʅ;
Description
The config variable modifier is used when declaring a variable to indicate that the variable's initial value should come from a value specified in the configuration settings. If there is no value defined in the configuration settings and no initial value is provided in logic, the compiler will issue a warning message. When looking for the initial value, the case of the variable name must match the case of the attribute defined in the configuration settings.
The config modifier can be used when declaring variables of types:
  • numeric
  • string
If no value exists in the configuration settings, numeric values will default to the value notappl and strings will default to "".
Example 1
// if no attribute named "serverUrl" exists in the configuration settings,
// the compiler will issue a warning and the variable's value will start as ""
config string serverUrl;

syncconnect(CSWeb, serverUrl);
Example 2
// if an attribute named "censusYear" exists in the configuration settings, its value will initialize censusYear;
// if no attribute exists, censusYear will start as 2024
config numeric censusYear = 2024;
See also: User and Configuration Settings, ensure Variable Modifier, persistent Variable Modifier