~x=%0% / if macro is called without arguments display summary ~?x>0 ~$>start ~x=%o% ~o|2 ~/***************************************************************************** ~/ERRCHK 1.0 - Wrapper macro to check for the number of fatal errors and ~/ warnings which are generated during the execution of the ~/ macro call that is given in the arguments of ERRCHK. ~/ ~/Calling sequence: ~ [] ~/ ~/Return value: The number of errors is returned in text register t9. ~/ If no errors occurred t9 is left blank. ~/ ~/The main purpose of this macro is to illustrate how to test for the ~/occurrence of warning errors, as those resulting e.g. from batch input ~/errors or warnings during assignment preparation/execution. For ERRCHK ~/to work correctly with fatal errors, it is necessary for the called macro to ~/catch these by means of ~?e conditionals. ~/ ~/(Heinz Spiess, Haldenstrasse 16, CH-2558 Aegerten, Switzerland 97-05-29) ~/***************************************************************************** ~o=%x% ~$done ~:start ~t9= ~p=32 / save old value of NLERR (see EMME/2 Manual page C-6) ~x=%p% / then call the specified macro with optional arguments ~<%t0% ~?x=%p% / if NLERR did not change no errors occurred, so quit ~$done ~x/10000 / else compute the difference and return value in t9 ~y=%p% ~y/10000 ~y-%x% ~t9=%y% ~x=%p% / now extract the error number of the last error ~x%10000 / and display the information on the screen ~o=2 ~/ ~/---------------------------------------------------------------------------- ~/ERRCHK: During the execution of macro "~<%t0%" ~/ %y% fatal errors or warnings occurred. ~/ The number of the last error was %x%. ~/---------------------------------------------------------------------------- ~/ ~:done