Dear Alex,
The sample you show means a different case.
If you stuff through exception, it will only be caught by finally or except
block. In that case the caller of your function to check your function value
line will not be executed.
so you may write like that
begin
try
// do my stuff which may through exception
// in this case FALSE will be returned
// at the end of all
result := TRUE;
except
// By the way, this block eat all your exceptions, and do nothing,
it is not recommended
result := False;
end;
end;
Best Regards
Leigh Wanstead
----- Original Message -----
From: Alex Kouznetsov <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Wednesday, March 01, 2000 8:39 AM
Subject: [DUG]: Default boolean result and hints
> If function returning boolean does not set returned value, would the
result
> be unpredictable or always FALSE. I assume it is unpredictable and use
this
> simple technique.
>
> begin
> result := false;
> // do my stuff which may through exception
> // in this case FALSE will be returned
> // at the end of all
> result := TRUE;
> end;
>
> This is fine to me but Delphi gives me a kind hint that Value assigned to
> Result (first operator) never used. I do not like to see anything in my
> output window.
>
> ???
>
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz