Previous Topic: Language StructureNext Topic: Operators


Keywords

The following are Keywords used in CA DMM Scripts.

Detection

Denotes the Detection function. Detection the first function the application calls. The Detect command (described previously) and Option commands must appear in this function.

Usage:
function Detection()
{
// detection statements
}
false

Represents 0.

Examples:
if (KeyExists( "HKLM\\Software\\Microsoft\\Plus!", false))
   StoreKey( "HKLM\\Software\\Microsoft\\Plus!");

if (Detect ("winword.exe") == false)
   return;
Function

Declares any function and must appear before a General function name. A function must be defined before it is invoked from within the script. Only the General commands (not Store or Apply commands) can occur in this function.

Usage:
function <function name> ( )
{
   // do something
}
Example:
function MyStoreFunction()
{
  //do something
}
#include

Enables the include file to be parsed. Any assigned variables in the header file are inserted into the global scope of the script. The header file can include functions that can be invoked from the script or from the interpreter. The Include files must contain appropriate statements and must not be ended with a semicolon.

First parameter:

The file name (string value)

Usage:
#include <file name>
Example:
#include "Script.hdr"
PreProcess

Denotes the PreProcess function. This function is always invoked before any store functions. If a network migration this function is invoked on the server. Only the General commands are allowed in this function.

Usage:
function PreProcess()
{
// statements to run before any storing takes place
}
PostProcess

Denotes the PostProcess function. This function is always invoked after all apply functions. Only the General commands are allowed in this function.

Usage:
function PostProcess()
{
// statements to run after all applying takes place
}
var

Specifies that a variable is to be local to the immediate scope. This variable allows for recursion in scripts.

Usage:
var myLocalVariable;
Example:
function RecursionTest( strRecursionCount )
{
Print("enter RecursionTest = " + strRecursionCount );

     if (strRecursionCount != "xxxx")
     {
          var strIfScope = strRecursionCount + "x";

          RecursionTest( strIfScope );
     }
     else
     {
          return;
     }

     Print("leave RecursionTest = " + strRecursionCount );
}

function MyTestFunction()
{
     RecursionTest( "x" );
}
true

Represents 1.

Example:
if (KeyExists(  "HKLM\\Software\\Microsoft\\Plus!", true ))
   ApplyKey( "HKLM\\Software\\Microsoft\\Plus!" );