Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
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