multi catch

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Jul 26 07:12:15 PDT 2008


"Zarathustra" <adam.chrapkowski at gmail.com> wrote in message 
news:g6epg8$24r7$1 at digitalmars.com...
> How to create few catches?
> for example:
> try{
>  ...
> }
> catch(Object o){
>  ...
> }
> catch(Exception e){
>  ...
> }

Always order your catches from most-derived to least-derived.  So,

try { .. }
catch(Exception e) { .. }
catch(Object o) { .. }

That's what the "catch at foo hides catch at bar" means. 




More information about the Digitalmars-d-learn mailing list