Previous Topic: Language StructureNext Topic: Operators


Keywords

The following are Keywords used in CA DMM Scripts.

Detection

Denotes the Detection function. This is the first function called by the application. The Detect command (described previously) and Option commands should 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 called from within the script. Only 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 script's global scope. The header file can include functions that can be called from the script or from the interpreter. Include files must contain appropriate statements. This include statement should 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 called before any store functions. In the case of a network migration this function is called on the server. Only 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 called after all apply functions. Only 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 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!" );