handle user input in OpenMaple
user_data pointer passed to StartMaple (Long)
indicates when readline has been called inside the debugger (boolean)
This OpenMaple function is part of the MapleCallBack structure passed as an argument to StartMaple.
The readLineCallBack function is called when the kernel executes the Maple readline command (which is also used by readstat and history) to obtain a line of input from the user. In most applications, this is not used.
The prototype for the function that you can assign to the entry in the MapleCallBack must look like the following.
Function ReadLineCallBack(ByVal data As Long,
ByVal dbug As Long) as Long
The debug parameter indicates that the call to readline was made by the Maple debugger (the Maple debugger uses readline to get debugger commands from the user). If debug is TRUE, the readline call is from the debugger. If debug is FALSE, the readline call is from history, readstat, or another non-debugger call.
If no readLineCallBack function is provided, any attempt to execute the Maple readline function produces an error (reported using the errorCallBack or textCallBack).
The data parameter contains the same data as passed to StartMaple in the user_data parameter.
Function ReadLineCallBack(ByVal data As Long, ByVal dbug As Long) As Long
ReadLineCallBack = MapleStringToPointer(Form1.Text1.Text)
' assignment to MapleCallback entry
cb.lpReadLineCallBack = GetProc(AddressOf ReadLineCallBack)
' test statement that will invoke the ReadLineCallBack
EvalMapleStatement kv, "readline();"
Download Help Document