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

Function Named Arguments

CSPro Logic
Some CSPro logic functions have optional arguments that can only be specified by supplying the name of the parameter, followed by the := operator, and then the argument. Named arguments appear in the text editor colored in a reddish color. The general form is:
function_name(ʃrequired_argumentsʅ, parameter_name1 := argument1ʃ, ...ʅ);
For example, the ValueSet.add function allows you to specify the filename of an image to associate with a value:
flowers_vs.add("Rose", 1, image := "red-rose.jpg");
Multiple named arguments can be supplied in any order. Both of these statements are identical:
flowers_vs.add("Rose", 1, image := "red-rose.jpg", textColor := "#ff0000");
flowers_vs.
add("Rose", 1, textColor := "#ff0000", image := "red-rose.jpg");
For functions that use named arguments, the arguments that can be specified will be documented in the help page for that function.
Action Invoker
When using the Action Invoker from CSPro logic, named arguments are used to identify each argument. For example:
string manualText = CS.File.readText(path := "manual.txt");