Close
Close window
WARNING - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

WARNING

write a warning message to the current output stream

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

(2)
>

interfacewarnlevel=0

3

(3)
>

f4

2I

(4)
>

interfacewarnlevel=4

0

(5)
>

WARNING%1 CPU seconds used&comma;time


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /