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
MapleRaiseError - raise a Maple error in external code
MapleRaiseError1 - raise a Maple error in external code
MapleRaiseError2 - raise a Maple error in external code
Calling Sequence
MapleRaiseError(kv, msg)
MapleRaiseError1(kv, msg, arg1)
MapleRaiseError2(kv, msg, arg1, arg2)
Parameters
kv
-
kernel handle returned by StartMaple
msg
error message
arg1, arg2
Maple objects
Description
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
These functions raise the Maple error described by msg, equivalent to the Maple command error(msg,arg1,arg2);.
When an error is raised, the errorCallBack is invoked, and execution continues at the next statement. OpenMaple interrupts a computation at an error invoked by MapleRaiseError when the external function is launched via MapleTrapError.
The character string msg can contain wildcards of the form %N, where N is a non-zero integer. These wildcards are replaced by the extra argument, arg1 or arg2, before displaying the message. If %-N is specified, then the optional argument is displayed with the appropriate suffix, st, nd, rd, or th, appended. For example, consider the following command.
MapleRaiseError2kv, "the %-1 argument, '%2', is not valid",
ToMapleInteger(i), args(i)
This, if invoked, raises the error, "the 4th argument, 'foo', is not valid", assuming i=4, and args(i) is set to the Maple name, foo. For more information, see error. The only option not allowed is %0 because the function cannot determine the number of unparsed optional arguments.
Examples
Sub MyGuessInput(ByVal kv As Long)
Dim i, n As Long
For i = 1 To 10
n = MapleToInteger32(kv, EvalMapleStatement(kv, "rand(-10..10)();"))
If n <= 0 Then
MapleRaiseError1 kv, "%1 is too small", ToMapleInteger(kv, n)
ElseIf n > 1 Then
MapleRaiseError1 kv, "%1 is too big", ToMapleInteger(kv, n)
End If
Next i
End Sub
See Also
OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples
Download Help Document