以下是 CA DMM 脚本中使用的关键字。
表示 Detection 函数。 这是应用程序调用的第一个函数。 此函数中应出现 Detect 命令(先前已作说明)和 Option 命令。
function Detection()
{
// detection statements
}
表示 0。
if (KeyExists( "HKLM\\Software\\Microsoft\\Plus!", false)) StoreKey( "HKLM\\Software\\Microsoft\\Plus!");
if (Detect ("winword.exe") == false)
return;
声明任何函数,且必须出现在 General 函数名称之前。 从脚本中调用函数之前,必须先定义它。 在此函数中,只能出现一般命令(不能出现 Store 或 Apply 命令)。
function <函数名> ( )
{
// 执行一些操作
}
function MyStoreFunction()
{
//执行一些操作
启用要被解析的包括文件。 头文件中分配的任何变量已插入到脚本的全局范围中。 头文件可包括能够从脚本或解释程序中调用的函数。 包括文件必须包含相应的语句。 该包括语句不应以分号结尾。
文件名(字符串值)
#include <文件名>
#include "Script.hdr"
表示 PreProcess 函数。 此函数始终在任意 Store 函数之前调用。 在网络迁移情况下,则在服务器上调用此函数。 此函数中只允许一般命令。
function PreProcess()
{
// statements to run before any storing takes place
表示 PostProcess 函数。 此函数通常在所有 Apply 函数之后调用。 此函数中只允许一般命令。
function PostProcess()
{
// statements to run after all applying takes place
指定变量为当前范围的局部变量。 这样允许在脚本中出现递归。
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" );
表示 1。
if (KeyExists( "HKLM\\Software\\Microsoft\\Plus!", true )) ApplyKey( "HKLM\\Software\\Microsoft\\Plus!" );
|
版权所有 © 2014 CA Technologies。
保留所有权利。
|
|