errorCallBack - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


errorCallBack

handle error output in OpenMaple

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

errorCallBack(data, offset, msg)

Parameters

data

-

user_data pointer passed to StartMaple (Long)

offset

-

integer

msg

-

error message (byte array pointer)

Description

• 

This OpenMaple function is part of the MapleCallBack structure passed as an argument to StartMaple.

• 

The errorCallBack function is called when an error occurs during parsing or processing.

• 

The prototype for the function you can assign to the entry in the MapleCallBack must look like the following.

Sub ErrorCallBack(ByVal data As Long,

     ByVal Offset As Integer,

     ByVal Output As Long)

• 

The offset parameter indicates the location of a parsing error. If offset >= 0, the error was detected at the specified offset in the string passed to EvalMapleStatement. If offset < 0, the error is not a parsing error; it is a computation error.

• 

The msg parameter contains the text of the error message.

• 

The data parameter contains the same data as passed to StartMaple in the user_data parameter.

• 

If an errorCallBack function is not specified, error messages are sent to the textCallBack function, with the MAPLE_TEXT_ERROR tag.

Examples

Public Sub ErrorCallBack(ByVal data As Long, _

          ByVal Offset As Integer, ByVal Output As Long)

   MsgBox " at offset " + str(Offset) + " " + _

      MaplePointerToString(Output), vbInformation, ""

End Sub

' assignment to MapleCallback entry

cb.lpErrorCallBack = GetProc(AddressOf ErrorCallBack)

' test statement that will invoke the ErrorCallBack

EvalMapleStatement kv, "error(""invalid argument: %1"",x+y);"

See Also

callBackCallBack

OpenMaple

OpenMaple/VB/API

OpenMaple/VB/Examples

queryInterrupt

readLineCallBack

redirectCallBack

StartMaple

statusCallBack

streamCallBack

textCallBack