[Contents] [Prev] [Next] [Index] [Report an Error]

Environment Commands

Macros use environment commands to write data to the macro output, to determine a value, or to call other commands. Table 58 describes the environment commands that are currently supported.

Table 58: Environment Commands

Command

Description

env.delay(int delay)

Causes the macro to delay further execution for the number of seconds specified by delay

env.getLine

Prompts the user with a question mark (?) and waits for a response

env.getLine(string prompt-string)

Prompts the user with the value of prompt-string and waits for a response

env.getLineMasked

Prompts the user with a question mark (?), waits for a response, and echoes the response with an asterisk (*) for each character entered by the user

env.getLineMasked(string prompt-string)

Prompts the user with the value of prompt-string, waits for a response, and echoes the response with an asterisk (*) for each character entered by the user

env.argc

Returns the number of arguments passed to the macro

env.argv(n)

Returns the value of the nth argument, such that 1 <= n <= env.argc

The returned value is a string, not a number; if you want to use this value for a subsequent numeric operation, you must first convert it to a number with the env.atoi(string) command

env.argv(0)

Returns the name of the macro

env.atoi(string)

Converts the specified string to a numeric value

env.atoi(env.argv(n))

Converts input values to integers

env.setResult

Sets parameters within a macro for display through the macroData log at the NOTICE severity level following the completion of the macro

env.getErrorCommand

Returns the command string that triggered a macro error

env.getErrorStatus

Returns the reason for a triggered error

env.startCommandResults

Starts the capture of command output

env.stopCommandResults

Stops the capture of command output

env.getResults

Returns one line of output from the capture buffer

env.regexpMatch(string)

Checks a string against a regular expression

env.getRegexpMatch(string)

Extracts a string from a larger string


[Contents] [Prev] [Next] [Index] [Report an Error]