Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
WARNING - write a warning message to the current output stream
Calling Sequence
WARNING(msgString, msgParam1, msgParam2, ...)
Parameters
msgString
-
text of warning message
msgParam[i]
parameters 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 string "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 is a string value which is independent of any parameters that are to be part of the message (for instance, the string complaining about an unassigned variable must not mention the variable by name). The string may however contain numbered parameter locations, of the form '%n' when n is a decimal integer.
The msgParams are one or more arbitrary Maple objects that will be substituted into numbered parameter locations in the msgString.
In the msgString, numbered parameters are used for placeholders for actual values or names. For example, the warning "f has a 2nd argument, x, which is missing" is specified by the msgString "%1 has a %-2 argument, %3, which is missing", and the msgParams f, 2, and x.
Each numbered parameter consists of the percent symbol, "%", optionally followed by a minus sign, "-", followed by one or more digits, making up an integer n. At message display time, the nth msgParam will be substituted for the numbered parameter.
A numbered parameter of the form %n will display the nth msgParam in lprint notation.
A numbered parameter of the form %-n will display the nth msgParam, assumed to be a Maple integer, in ordinal form. For example, the value 2 is displayed as "2nd".
The special parameter, %0, will display all the msgParams, separated by a comma and space.
Examples
f := proc(x) if x<0 then WARNING("result is complex") end if; sqrt(x) end proc;
Warning, result is complex
Warning, .76e-1 CPU seconds used
See Also
error, interface, sprintf
Download Help Document