ReadConfiguration

(VTScada-Layer function. Must be called with a leading backslash.)

Description: This function provides a safe way to read configuration files.
Returns: Nothing
Usage: Script Only.
Function Groups: File I/O
Related to: ModifyConfiguration | ReadPropertiesFile | WCSubscribe
Format: \ReadConfiguration(CallBackModuleName)
Parameters:  
CallBackModuleName
Required text value, which is the name of the module (either launched or a subroutine that returns Invalid) . The named module is launched in the caller.
Comments: The callback object is allowed to read configuration files and is guaranteed that, for the life of the module, no other configuration code can modify the file. The callback module need not have parameters of its own. ReadConfiguration will not put values in them if they exist.

Example:

  If SomeTrigger; 
  [
    SomeTrigger = 0; 
    \ReadConfiguration("ConfigReader");
  ] 
…
] 

<
{============================= \ConfigReader ==========================}
{======================================================================}
ConfigReader

Main [
  If 1; 
  [
     { The first line of the file is read into InfoVal1, and the second }
     { line is read into InfoVal2.                                    }
    FRead("MyConfigFile.txt" { filename         },
          0                  { offset           }, 
          "%l%l"             { format string    },
          InfoVal1, InfoVal2  { return variables });
    Return(Invalid); 
  ] 
] 
{ End of \ConfigReader }
>