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 are accessed from logic with the loadsetting
function and are modified using the savesetting
function. 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:
And then another program might automatically fill in the interviewer name based on the saved setting:
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 string variable using the config
type. Unlike user settings, configuration settings cannot be modified in logic. They can only be modified using the dialog box.
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 GitHub:
For this to work, you need to use the dialog box to add an attribute ftp_server_url with its value being the FTP server URL.