SetOverride

(Engine-Level Function)

Description: Allows the overriding of OpCodes with a specified script module within a  static module tree.
Warning: This statement should be used by advanced users only. Effective use of this function requires a thorough understanding of VTScada programming.
Returns: Nothing
Usage: Script Only.
Function Groups: Advanced Module
Related to: GetOverrides
Format: SetOverride(TargetModule, OpCode, [Override, Recursive])
Parameters:  
TargetModule
Required. Any expression that can be resolved to the module value that will be modified.
OpCode
Required. Any numeric value that represents the built-in function to replace.
Override
The module value that will be called in place of OpCode. If invalid or missing, any existing overrides of OpCode in TargetModule will be removed.
Recursive
Required. If true, the OpCode will be replaced with calls to the override function in all of the child modules of the target module. Otherwise, only the target module will be altered. Defaults to true.
Comments: Adds the ability to override a built-in function inside a module with a  call to a different module. The purpose of this feature is to help with testing of modules that use time, streams, etc. so that these functions can be overridden with more controllable inputs.