• <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
      • Procedural Sections
      • Logic
        • View Logic
        • Create and Edit Logic
        • Find and Replace Logic
        • Compile Logic / An Application
        • OnKey Character Map
        • OnViewQuestionnaire Global Function
        • User and Configuration Settings
        • String Encoder Dialog
        • Path Adjuster Dialog
        • Symbol Analysis
      • 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>

User and Configuration Settings

With a data entry or batch edit application active, select View -> User and Configuration Settings. A dialog box will open that lets you add, modify, or delete user and configuration settings. These settings are attribute-value pairs that are alternate ways to store information (rather than using external dictionaries, working storage dictionaries, or text files). A setting, the "value," is stored in a way that can be looked up using an "attribute" key. Both the value and attribute are strings.
User Settings
User settings are accessed from logic using the loadsetting function or Settings.getValue action. User settings are modified using the savesetting function or Settings.putValue action. Unless otherwise specified, all CSPro applications on a device share the same settings, which make user settings a convenient way to share information across different applications. For example, a menu program might save some information:
PROC INTERVIEWER_NAME

   
savesetting("InterviewerName", INTERVIEWER_NAME);
And then another program might automatically fill in the interviewer name based on the saved setting:
PROC INTERVIEWER

preproc

    INTERVIEWER = 
loadsetting("InterviewerName");
   
noinput;
Configuration Settings
Configuration settings are stored locally on your device and are loaded at compile time. The value of a configuration setting is accessible by declaring a variable using the config modifier. Unlike user settings, configuration settings cannot be modified in logic. They can only be modified using the dialog box.
Because binary data entry applications (.pen files) are only compiled with the .pen file is created, the configuration settings stored on the computer used to create the file are saved in the .pen file.
Configuration settings are a convenient way to store some information outside of your logic file. If you are using a revision control system (e.g., Git), there may be some values, like the URL you are using to synchronize data, that you do not want to store in your publicly visible logic. You can define these settings on your machine without having to share them with strangers. For example, this is logic that you can safely commit to a public repository:
config ftpServerUrl;

syncconnect(FTP, ftpServerUrl);
For this to work, you need to use the dialog box to add an attribute "ftpServerUrl" with the FTP server URL as its value.
See also: config Variable Modifier, loadsetting Function, savesetting Function, Settings Action Invoker Namespace, CSEntry Settings Modification