[Gambas-user] Behaviour FINALLY CATCH

Benoît Minisini g4mba5 at gmail.com
Sun Apr 1 18:41:18 CEST 2018


Le 01/04/2018 à 18:32, Michael N. Altrogge a écrit :
> I have a problem while using Finally / Catch ...
> 
> The finally part is ONLY executed if empty, even the entry is a comment.
> 
> 
> This will NOT work:
> 
> /Public Function fncCheckDigit() As Integer
> 
>      ...
> 
>      intZahl= intWert1 / 0
> 
>      ...
> 
> Finally                     ' Aufräumen nach Fehler
>      'Blah blah blubb
> 
> Catch                       ' Fehlerbahndlung
>      For Each strError In Error.Backtrace
>          Debug strError & gb.NewLine
>      Next
> 
> End
> /
> This will work:
> 
> /Public Function fncCheckDigit() As Integer
> 
>      ...
> 
>      intZahl= intWert1 / 0
> 
>      ...
> 
> Finally                     ' Aufräumen nach Fehler
> 
> Catch                       ' Fehlerbahndlung
>      For Each strError In Error.Backtrace
>          Debug strError & gb.NewLine
>      Next
> 
> End
> //
> /Is this the expected behaviour?
> /
> 

Sorry, I don't understand what you mean. If the FINALLY part is void, 
what do you expect him to do?

-- 
Benoît Minisini


More information about the User mailing list