Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.
warning [-noContext] [-showLineNumber boolean]
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 a warning message heading and surrounded by the appropriate language separators (# for Python, // for Mel).None
| Long name (short name) | Argument types | Properties | ||
|---|---|---|---|---|
-noContext(-n)
|
|
|
||
|
||||
-showLineNumber(-sl)
|
boolean
|
|
||
|
||||
proc lightWarning()
{
$l = `ls -lights`;
if (size($l) == 0) {
warning "No Lights";
}
}
lightWarning()
//
// The above will produce the following output:
//
// // Warning: No Lights //
//
// When the option to show line numbers in errors is enabled the output will
// be the following:
//
// // Warning: line 5: No Lights //
//