• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Statements and Functions
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Program Control Statements
      • Assignment Statements
        • Assignment Statement
        • Recode Statement
        • Impute Function
        • SetValue Function
        • GetValue Function
      • 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
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for MapView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for ShpToMap>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for CSWeb>

GetValue Function

Formats
d = getvalue(variable_name『,occurrence1,...,occurrence3』);

d = getvaluenumeric(variable_name『,occurrence1,...,occurrence3』);

s = getvaluealpha(variable_name『,occurrence1,...,occurrence3』);
Description
The getvalue function returns the value of a variable when the variable name is not known at compilation time (when writing the application). The function searches for a variable with a name stored in the string expression variable_name, and if such a variable is found, the function returns the value of that variable.
The functions getvalue and getvaluenumeric return the value of numeric variables. The function getvaluealpha returns the value of an alphanumeric variable. Optional parameters, occurrence1 to occurrence3, allow you to pass occurrence numbers to the function.
Return Value
The function returns the variable's value if the variable name was found. If a numeric variable was not found, the functions getvalue and getvaluenumeric return default. If an alphanumeric variable was not found, getvaluealpha returns a blank string.
Example
errmsg("The current field's value is %d",getvalue(getsymbol()));
See also: SetValue Function