Am 10.07.2017 15:46 schrieb "Graeme Geldenhuys" <
mailingli...@geldenhuys.co.uk>:
>
> On 2017-07-10 13:34, Dmitry Boyarintsev wrote:
>>
>> are you referring to "Catching More Than One Type of Exception with One
>> Exception Handler" in
>> https://docs.oracle.com/javase/tutorial/essential/exceptions/catch.html
>
>
> Yes. You can have multiple catch blocks inside the same try block. You
can also have a single catch block with a comma separated list of exception
types.

You can catch multiple exception types in Object Pascal as well:

=== code begin ===

try
expect
  on e: EWhatever do ...;
  on e: EFoobar do ...;
  else ...
end;

=== code end ===

Though you can't use the same code block for multiple types.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to