RecordProperty

Code layer

Description: Modifies one or more properties within a single properties file and commits the result.
Returns: Object reference to itself, which becomes invalid on completion.
Usage: Script Only.
Function Groups: Configuration Management
Related to:
Format: \RecordProperty(SettingsFile, Section, Name, Value[, Comment, CommitComment, Deploy, CallerHasLock, ClearSection, Workstation])
Parameters:  
SettingsFile
Required. Text or Integer. The name of the settings file to be altered.
As a convenience this parameter can also be an integer representing any of the four standard settings file types as follows:
0 => workstation.Dynamic
1 => Settings.Dynamic
2 => workstation.Startup
3 => Settings.Startup
Section

Required. May be the name of the section that the property belongs to, or an array of section names.

The section will be <hidden> or [visible] according to the optional Hide parameter.

Name
Required. May be the name of the property to modify, or an array of property names.
Value
Required. May be the value to be set for the property, or an array of values matching the array of property names.
Comment
Optional. May be the comment to add to the property or an array of comments matching the array of property names.
If invalid, the existing comment will be used.
CommitComment
Optional. The comment to be added when the change is committed to the repository.
Deploy
Optional Boolean. Set TRUE to deploy the change immediately.
CallerHasLock
Optional Boolean. Set TRUE if the caller holds the layer lock in write mode.
ClearSection
Optional Boolean. Set TRUE to empty the section (or sections if an array was provided), before writing the new value(s).
Workstation
Optional text. If an integer 0 or 2 was used for the SettingsFile parameter, then the name of the workstation should be provided.
Defaults to the current workstation (WkStaInfo(0)) if missing or invalid.
Hide
Optional Boolean. Set TRUE to hide the section or FALSE to reveal it. Invalid will leave the section as it is.
UserID
Optional text. The user account to be associated with the revision. Defaults to the currently signed-in user.
Comments: This function returns an object reference to itself, which becomes invalid when the operation (handled asynchronously) is complete.

Examples:

Init {
  If 1 WaitEnable;
  [
     { Enable the Alarm Text-to-Speech feature }
    Result = \RecordProperty(1 {Settings.Dynamic},
                                  "System", "AlarmSpeechEnable", 
                                  1 { Enable },
                                  Invalid { Leave the existing comment }, 
                                  "Enable Alarm Text-to-Speech" { Comment for the commit}, 
                                  TRUE { Deploy });
  ]
]

WaitEnable [
  If !Valid(Result);
  [
     { Do something with related to a spoken alarm }
  ]
]