WARNING - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


WARNING

write a warning message to the current output stream

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

WARNING(msgString, msgArg1, msgArg2, ...)

Parameters

msgString

-

text of warning message

msgArg1, msgArg2, ...

-

arguments to substitute into msgString

Description

• 

A call to the WARNING function causes a warning to be produced on the current output stream. The message is displayed preceded by the prefix "Warning,".

• 

If warnings are turned off, via interface(warnlevel=0), the warning will not be produced, and the call to WARNING will have no effect.

• 

The msgString and any msgArg arguments specify how the warning is displayed. The same formatting rules applied to the error statement are used for warnings, except that display of a warning does not stop execution and throw an exception, and the message itself is prefixed by "Warning," instead of "Error,".

• 

For details on the construction of WARNING %n parameter forms (also supported by error and StringTools:-FormatMessage), refer to Error and Warning Message Formatting.

Examples

f := proc(x) if x<0 then WARNING("result is complex") end if; sqrt(x) end proc;

fprocxifx<0thenWARNINGresult is complexend if&semi;sqrtxend proc

(1)

f3

I3

Warning, result is complex

interfacewarnlevel=0

0

(2)

f4

2I

(3)

interfacewarnlevel=4

0

(4)

WARNING%1 CPU seconds used&comma;time

Warning, .27e-1 CPU seconds used

See Also

error

interface

sprintf

StringTools:-FormatMessage