WARNING
write a warning message to the current output stream
Calling Sequence
Parameters
Description
Examples
WARNING(msgString, msgArg1, msgArg2, ...)
msgString
-
text of warning message
msgArg1, msgArg2, ...
arguments to substitute into msgString
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.
f := proc(x) if x<0 then WARNING("result is complex") end if; sqrt(x) end proc;
f ≔ procxifx<0thenWARNING⁡result is complexend if;sqrt⁡xend proc
f⁡−3
I⁢3
Warning, result is complex
interface⁡warnlevel=0
0
f⁡−4
2⁢I
interface⁡warnlevel=4
WARNING⁡%1 CPU seconds used,time⁡
Warning, .27e-1 CPU seconds used
See Also
error
interface
sprintf
StringTools:-FormatMessage
Download Help Document