CaptureSettings

Description: Gathers a single property value or an accumulated section and returns the result in a tabular format.
Returns: Object
Usage: Script Only.
Function Groups: Configuration Management
Related to: GetINIProperty |
Format: LayerRoot\CaptureSettings(Section, ValueName, pResult, CallerHasLock)
Parameters:  
Section
Required. The name of the section where the property will be found.
ValueName
Required. The name of the property to return. Set to Invalid to retrieve the entire section.
pResult
Required. A pointer to a variable, in which the retrieved property or properties will be returned.
CallerHasLock
Boolean. Set to TRUE if the caller holds the semaphore.
Comments: This function gathers settings data from an active cache that keeps up-to-date inheritance information across all ancestor layers back to the setup.INI file for the VTScada System layer. This is the preferred method for inquiring about the current value of a setting that is not stored in a "Code" object variable ("Code" variables are created for settings in the [SYSTEM], [LABELS], and [AREAS] sections).
This is an asynchronous operation which in most cases executes very quickly, its return value is an object which becomes invalid when the op completes. The caller must not slay itself while this object is valid.

Comments are not included in the output, but hidden values are. The settings accumulation is stored in a Layer-level variable named CaptureCache. This variable is refreshed on the next call after a settings file changed as reported by LayerSettingsMod\LayerNotify via the RecaptureSettings flag. If this flag isn't set then CaptureSettings simply reads the requested value from the cache without acquiring the lock. The check is performed in a critical section to prevent result corruption due to settings changes on other threads.

Examples:

EmailProperties  = \LayerRoot\CaptureSettings("System", "OutBoundEmailSettings", &EmailSettings, 0);