Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
queryInterrupt - interrupt a computation in OpenMaple
Calling Sequence
queryInterrupt(data)
Parameters
data
-
user_data pointer passed to StartMaple ()
Description
This OpenMaple function is part of the MapleCallBack structure passed as an argument to StartMaple.
The queryInterrupt function allows the user to halt computation. This function is called before each Maple statement is executed. In general, this occurs hundreds of times per second. For some operations (notably large integer manipulations), the queryInterrupt function is called only every few seconds.
The prototype for the function that you can assign to the entry in the MapleCallBack must look like the following.
Function QueryInterrupt(ByVal data As Long) As Long
To halt the computation, the function must return True. To continue the computation, the function must return False.
The data parameter contains the same data as passed to StartMaple in the user_data parameter.
Examples
Public ShouldStop As Boolean
ShouldStop = False
Public Function QueryInterrupt(ByVal data As Long) As Long
If ShouldStop Then
MainForm.StopButton.Caption = "Stop"
QueryInterrupt = True
Else
QueryInterrupt = False
End If
End Function
Private Sub StopButton_Click()
If Screen.MousePointer = vbHourglass Then
ShouldStop = True
StopButton.Caption = "Stopping ..."
End Sub
' assignment to MapleCallback entry
cb.lpQueryInterrupt = GetProc(AddressOf QueryInterrupt)
' test statement that will invoke the CallBackCallBack
EvalMapleStatement kv, "do end do;" 'infinite loop
See Also
callBackCallBack, errorCallBack, OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples, readLineCallBack, redirectCallBack, StartMaple, statusCallBack, streamCallBack, textCallBack
Download Help Document