• <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
      • 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
        • Compress Function
        • Decompress Function
        • diagnostics Function
        • Encode Function
        • ErrMsg Function
        • ExecSystem Function (Desktop)
        • ExecSystem Function (Mobile)
        • ExecPFF Function
        • GetProperty Function
        • GetLabel Function
        • GetLanguage Function
        • GetSymbol Function
        • GetValueLabel Function
        • hash Function
        • htmldialog Function
        • InValueSet Function
        • Invoke Function
        • IsChecked Function
        • loadsetting Function
        • LogText Function
        • MaxValue Function
        • MinValue Function
        • paradata Function
        • PathConcat Function
        • PathName Function
        • savesetting Function
        • SetLanguage Function
        • SetProperty Function
        • SetValueSet Function
        • SetValueSets Function
        • Special Function
        • sqlquery Function
        • Stop Function
        • SysParm Function
        • tr Function
        • Trace Function
        • UUID Function
        • View Function
        • Warning Function
      • 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>

loadsetting Function

Format
s = loadsetting(attributeʃ, default_settingʅ);
Description
The loadsetting function, using the string expression attribute, retrieves a setting from an attribute-value pair, a setting that has been previously saved using the savesetting function. An optional string or numeric expression default_setting can be provided and will be returned if no value has been saved for the given attribute.
The file from which settings are retrieved can be modified by altering the CommonStore attribute of a PFF file.
Settings can also be retrieved using the Settings.getValue action. The persistent variable modifier can also be used to serialize settings across application runs.
Return Value
The function returns a string containing the value associated with the attribute. If no value is associated with the attribute, then the function returns a blank string unless a default setting has been provided, in which case it returns the default setting.
Example
PROC GLOBAL

function OnChangeLanguage()
   
// save the selected language so that the change is persistent,
    // being available the next time that the program is run
    savesetting("Language", getlanguage());
end;


PROC MY_APPLICATION_FF

preproc

   
// set the language at the start of the program, defaulting to English
    setlanguage(loadsetting("Language", "EN"));
See also: savesetting Function, Setting.getValue Action, User and Configuration Settings, persistent Variable Modifier, CSEntry Settings Modification