Hello,
In a Karel program I want to catch an error, reset it and treat it.
I tried with a condition handler
CONDITION [ 1 ] :
WHEN ERROR[*] DO
UNPAUSE
get_Err
ENDCONDITION
ENABLE CONDITION [ 1 ]
then in my routine get_Err I tried to get the most recent error message
ERR_DATA (MAXINT , iErrCode , sErr , iCause , sCause , iTime , iSeverity , sPrName )
My first problem is sErr does not correspond to the expected error..
The TP show the error "MOTN-017", so I expected to get sErr = "MOTN-017" but I get "R E S E T" which is in the alarm history but not the most recent at that time.
I tried to set another value in seq_num (0, 1, 10 ) but ERR_DATA always shows "R E S E T"...
Do you know how to do it right?
Second problem.
I want to reset the task and continue after having corrected the error.
So I my routine, I wrote "RESET(reset_ok)" but I don't know what I have to write after that. If I press the "run" button in roboguide the program continues, I am looking for a Karel command which have the same effect. Could you help me?