[DUG] What is the difference by using following two methods?

Robert martin rob at wildsoft.co.nz
Tue Aug 7 10:29:10 NZST 2007


Hi

I didn't even know you could do the TObject thing.  However it King of 
makes sense.  If you use Error : Tobject you are treating the exception 
object passed in as a generic TObject (base class), so it would work but 
you wouldn't have access to TException methods, like e.message. 


Rob Martin
Software Engineer

phone +64 03 377 0495
fax   +64 03 377 0496
web www.chreos.com

Wild Software Ltd



Leigh Wanstead wrote:
> Good morning,
>
> May I ask what is the difference by using following two methods?
>
>   try
>     ...
>   except
>     on Error: TObject do
>     begin
> 	...
>     end;
>
>   try
>     ...
>   except
>     on E: Exception do
>     begin
> 	...
>     end;
>
> Why can TObject be an object in try except block?
>
> TIA
>
> Regards
> Leigh
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe
>
>   


More information about the Delphi mailing list