Sam,

if you're just trapping strtoint convert errors then try:

strtointdef(get_markitem(2,msg), 0);

regards,
Steve

> -----Original Message-----
> From: Sam Clarke [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 21 June 2001 15:27
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Exception Handling (Delphi 5)
> 
> 
> Thanks, that all makes sense, I didn't realise it did 
> re-raise the exception
> if it was caught.  However I tried both options and it didn't 
> catch either.
> Here's the actual code.  
>     try
>         device_id := strtoint(get_markitem(2,msg));
>     except
>     on EConvertError do
>         device_id := 0;
>     end;
> 
> I also tried
> 
>     try
>         device_id := strtoint(get_markitem(2,msg));
>     except
>         device_id := 0;
>     end;
> 
> IT raises the exception when get_markitem(2,msg) returns a 
> null string (
> result = '').  (is this a null string??)
>  
> Thanks so much for your help
> sam
> 
> 
> > -----Original Message-----
> > From:       Steve Peacocke [SMTP:[EMAIL PROTECTED]]
> > Sent:       Thursday, 21 June 2001 15:04
> > To: Multiple recipients of list delphi
> > Subject:    Re: [DUG]:  Exception Handling (Delphi 5)
> > 
> > Nello Said lots of interesting things to show how dumb I 
> really am :)
> > >if the exception rasied is not a MyException
> > >then the exception is not handled and 'Got Out'
> > >will not display
> > 
> > That's an intersting discussion Nello and I can't wait to 
> get home and try
> > it out. As I said, I hardly ever use the "On ExceptionName 
> Do" but use the
> > general try/except.
> > 
> > I find it particularly interesting that if you have a 
> try/except such as
> > 
> > Except
> >    // do nothing
> > end;
> > ShowMessage('Here');
> > 
> > Then on ANY exception 'Here' will show as Delphi has handled the
> > exception. But, if I understand you correctly, if you have
> > 
> > except
> >    on ExceptionName do
> >       Show('Gotchya');
> > end
> > ShowMessage('Here');
> > 
> > then if the exception is not an 'ExceptionName' exception, 
> it will be the
> > same as if the exception is re-raised and 'Here' will not show.
> > 
> > Thanks for the insight.
> > 
> > Steve
> > 
> --------------------------------------------------------------
> ------------
> > -
> >     New Zealand Delphi Users group - Delphi List - 
> [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED] 
> > with body of "unsubscribe delphi"
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List - 
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to