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
textCallBack - handle text output in OpenMaple
Calling Sequence
textCallBack(data, tag, output)
Parameters
data
-
user_data pointer passed to StartMaple (Long)
tag
code indicating kind of text (Long)
output
output string (byte array pointer)
Description
This OpenMaple function is part of the MapleCallBack structure passed as an argument to StartMaple.
The textCallBack function is called with typical (non-exceptional) Maple output. The output that Maple generates, for example, an intermediate result or the output from a printf statement, is passed to the textCallBack function.
The prototype for the function that you can assign to the entry in the MapleCallBack must resemble the following.
Sub TextCallBack(ByVal data As Long,
ByVal tag As Integer,
ByVal Output As Long)
The tag parameter indicates the type of Maple output. The tag parameter can take one of the following values (as defined in maplec.h).
MAPLE_TEXT_OUTPUT
A line-printed (1-D) Maple expression or statement.
MAPLE_TEXT_DIAG
Diagnostic output (high printlevel or trace output).
MAPLE_TEXT_MISC
Miscellaneous output, for example, from the Maple
printf function.
MAPLE_TEXT_QUIT
Response to a Maple quit, done, or stop command.
MAPLE_TEXT_WARNING
A warning message generated during a computation.
MAPLE_TEXT_ERROR
An error message generated during parsing or
processing. This is generated only if you
do not specify an errorCallBack function.
MAPLE_TEXT_STATUS
Kernel resource usage status (a "bytes used"
message). This is generated only if you
do not specify a statusCallBack function.
MAPLE_TEXT_DEBUG
Output from the Maple debugger.
The output parameter contains the output of the type indicated by the tag parameter. Each output string can be arbitrarily long. Most output obeys interface(screenwidth), which is initially set to infinity. Some output is not line-broken, including output generated by printf (which controls its own formatting).
A single result may be split into multiple calls to the textCallBack function. In particular, this can happen when is not infinity. It is also true for formatted output like that generated by accessing help. A single command can generate many calls with different output tags.
The data parameter contains the same data as passed to StartMaple in the user_data parameter.
Examples
Public Sub TextCallBack2(ByVal data As Long, ByVal tag As Integer, _
Dim OutputString As String
OutputString = MaplePointerToString(Output)
If tag = MAPLE_TEXT_HELP Then
Write #2, OutputString
Else
Write #1, OutputString
End If
End Sub
' assignment to MapleCallback entry
cb.lpTextCallBack = GetProc(AddressOf TextCallBack)
' test statement that will invoke the TextCallBack
EvalMapleStatement kv, "x^2+3*x+1;"
EvalMapleStatement kv, "help(int);"
See Also
callBackCallBack, errorCallBack, interface, OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples, queryInterrupt, readLineCallBack, redirectCallBack, StartMaple, statusCallBack, streamCallBack
Download Help Document