Previous Topic Next topic Print topic


Exception Handling - in COBOL and

Exception Handling in Managed COBOL

*> Throw an exception
declare myException as type Exception = 
         new Exception(“Something is really wrong.").
raise myException 
 
*> Catch an exception. 
try
  set y to 0;
  compute x = 10 / y
catch myException  *> Argument is optional, no "When" keyword 
  display myException::Message
Previous Topic Next topic Print topic