Exceptions: Difference between revisions
PascalABC.NET
Langurmonkey (talk | contribs) |
(PascalABC.NET) |
||
Line 2,264:
=={{header|Pascal}}==
See [[Exceptions#Delphi | Delphi]]
=={{header|PascalABC.NET}}==
User defined exceptuin class
<syntaxhighlight lang="delphi">
type MyException = class end;
</syntaxhighlight>
Throw an exception
<syntaxhighlight lang="delphi">
raise new MyException;
</syntaxhighlight>
Catch an exception
<syntaxhighlight lang="delphi">
try
...
except
on e: MyException do
statement
end;
</syntaxhighlight>
=={{header|Perl}}==
|