SIGNAL - Auffangen von Fehlern

REXX Instruktionen
Andere Instruktionen

Syntax:                                 
SIGNAL  ON/OFF ERROR/FAILURE/HALT/NOVALUE/SYNTAX <NAME label>

/* REXX SIGNAL ON Copyright YCOS Yves Colliard Software 1990-2009 */
/* TRACE ?R  */
  /* einschalten des interaktiven Trace Modus */
  /* */
SIGNAL ON ERROR NAME generror
TRACZ ?R                        /* TRACZ falsch geschrieben  */
after_error:
  /* */
SIGNAL ON FAILURE NAME failerror
ADDRESS MVS 'TIME'              /* TIME ist ein TSO Kommando */
after_failure:
  /* */
SIGNAL ON NOVALUE NAME valueerror
DROP hugo                   /* Variable HUGO nicht vorhanden */
after_value:
  /* */
SIGNAL ON SYNTAX NAME synerror
if 7 then say "nicht gut"   /* Syntax error */
after_syntax:
SAY "The End"
  /* */
EXIT
  /* */
generror:
SAY "General Error"
SIGNAL after_error
  /* */
failerror:
SAY "Failure Error"
SIGNAL after_failure
  /* */
valueerror:
SAY "Value Error"
SIGNAL after_value
  /* */
synerror:
SAY "Syntax Error"
SIGNAL after_syntax