Exceptions: Difference between revisions

Content added Content deleted
Line 790: Line 790:
=={{header|PL/I}}==
=={{header|PL/I}}==
<lang>
<lang>
/* Define a new exception, called "my_condition". */
on condition (my_condition) snap begin;
on condition (my_condition) snap begin;
put skip list ('My condition raised.');
put skip list ('My condition raised.');
end;
end;


/* Raise that exception */
signal condition (my_condition);
signal condition (my_condition);

/* Raising that exception causes the message "My condition raised" */
/* to be printed, and execution then resumes at the statement */
/* following the SIGNAL statement. */
</lang>
</lang>