[Gambas-user] Elusive Gambas3 crashing bug
Benoît Minisini
gambas at ...1...
Mon Nov 15 22:11:16 CET 2010
> More...
>
> Shouldn't Finally to be read after Catch, not before?
> Now I get:
> TestErrorManagment(1) = 1 <-- Catch is never read!
> TestErrorManagment(2) = 21
>
> I exepected;
> TestErrorManagment(1) = 4
> TestErrorManagment(2) = 21
>
> Right now word Finally doesn't do anything.
>
>
> Private Function TestErrorManagment(iWhich As Integer) As Integer
> Dim iError As Integer
>
> If iWhich = 1 Then
> iError = 1 / 0
> Else
> iError = 20
> Endif
>
> Finally
> Inc iError
> Return iError
>
> Catch
> iError = 3
>
> End
>
>
> Jussi
>
'Finally' is always run before 'Catch'. And the Return statement prevents the
'Catch' part to be executed after the 'Finally' part.
Regards,
--
Benoît Minisini
More information about the User
mailing list