Go to: Synopsis. Return value. Related. Flags. MEL examples.

Synopsis

warning [-showLineNumber boolean] string

warning is NOT undoable, NOT queryable, and NOT editable.

The warning command is provided so that the user can issue warning messages from his/her scripts.

The string argument is displayed in the command window (or stdout if running in batch mode) after being prefixed with an error message heading and surrounded by //.

Return value

None

Related

error

Flags

showLineNumber
Long name (short name) Argument types Properties
-showLineNumber(-sl) boolean create
If true then file and line number information are displayed.
Default: false

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

$l = `ls -lights`;
if (size($l) == 0) {
    warning "No Lights";
}

// The above will produce the following output:
    // Warning: No Lights //

$l = `ls -lights`;
if (size($l) == 0) {
    warning -showLineNumber true "No Lights";
}

// Adding "-showLineNumber true" to the same example will produce the
// following output:
    // Warning: line 3: No Lights //