The following are Keywords used in CA DMM Scripts.
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.
function Detection()
{
// detection statements
}
Represents 0.
if (KeyExists( "HKLM\\Software\\Microsoft\\Plus!", false)) StoreKey( "HKLM\\Software\\Microsoft\\Plus!");
if (Detect ("winword.exe") == false)
return;
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.
function <function name> ( )
{
// do something
}
function MyStoreFunction()
{
//do something
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.
The file name (string value)
#include <file name>
#include "Script.hdr"
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.
function PreProcess()
{
// statements to run before any storing takes place
Denotes the PostProcess function. This function is always called after all apply functions. Only General commands are allowed in this function.
function PostProcess()
{
// statements to run after all applying takes place
Specifies that a variable is to be local to the immediate scope. This allows for recursion in scripts.
var myLocalVariable;
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" );
Represents 1.
if (KeyExists( "HKLM\\Software\\Microsoft\\Plus!", true )) ApplyKey( "HKLM\\Software\\Microsoft\\Plus!" );
|
Copyright © 2013 CA.
All rights reserved.
|
|