AddInitFunction

This action can be used to add function calls to the TInit or TMain transaction. This is the only action, which allows additional tags, besides the Conditions tag. While conditions are allowed, they are not useful because they can not reference any data.

There can be any number of functions specified, each one with its own Function tag. Within the Function tag, there must be the tag FunctionName and optionally the tag BdhFileName.

There can be any number of Param tags to specify parameters. Each parameter must have a Value tag and a Type tag. The Type tag can be either String or Const. String will put the parameter in quotes, Const won't.

<HttpScriptingRule>
  <Name>Automatically insert my useful function</Name>
  <Active>true</Active>
  <Action>AddInitFunction</Action>
  <Function>
    <FunctionName>InitMyLogLibrary</FunctionName>
    <BdhFileName>Log.bdh</BdhFileName>
    <Param>
      <Value>C:\Logs\xx.log</Value>
      <Type>String</Type>
    </Param>
    <Param>
      <Value>true</Value>
      <Type>Const</Type>
    </Param>
  </Function>
</HttpScriptingRule>

This will generate the following script fragments:

use "Log.bdh" 

transaction TInit
begin
  // ...
  InitMyLogLibrary("C:\\Logs\\xx.log", true);
end TInit;
Silk Performer allows the tag Location with the following values:
  • TInit
  • TMainBegin
  • TMainEnd