Question: How can I use the output of traperror?

I am debugging a Maple program (and I cannot contact its author). Allegedly, the program ran under some old version of Maple, but it does not run under my Maple 2015 or Maple 9. I am trying to make it run under Maple 2015. I found a place where the program does not do what it is expected to do, but don't know how to make it do what I want:-)

I inserted a DEBUG statement at some place in the program, and the debugger window opens when the program comes to that statement. I execute  the following statement in the debugger:  traperror(Groebner:-NormalForm(g,AA,matermorder)); if I get some benign result, such as 0, I push "continue" in the debugger, and the program runs until it gets to the DEBUG statement again. I repeat these two operations several times until the traperror statement gives the following: polynomials must be members of the algebra" (my comment: only one quotation mark).

So I would like to amend the program to process the exception differently from how it is done now, but I don't know how to get access to the result of the traperror statement. For example, when I am trying to execute the following operators in the debugger: adebug:= traperror(Groebner:-NormalForm(g,AA,matermorder));adebug; , I only get the following diagnostics: Warning, extra characters at end of parsed string  So I don't understand what adebug contains and how I can introduce some logic based on the contents of adebug to handle the exception differently.

I suspect I am missing something simple due to my lack of experience with Maple. I tried to put the result of traperror into a parse statement, but did not get any satisfactory results.

 

Thank you 

Please Wait...