[Gambas-user] "If Error" is ambiguous

Christof Thalhofer chrisml at deganius.de
Mon Sep 9 12:46:03 CEST 2019


Hello,

I think I found a bug in Gambas, but I am not sure:

Normally "If Error" is used to detect if an error happed (and afterwards
the programmer usually clears the error):

--------------------------------------------------------
Try blah()
If Error then
    DoSth()
    Error.Clear
EndIf
--------------------------------------------------------

But after Error.Clear Error continues to report True although the error
was cleared:

--------------------------------------------------------
Public Sub Main()

    Dim x As Float

    Try x = 2 / 0

    If Error Then
        Error.Clear
    Endif

    If Error Then
        Print "Error still true"
    Endif

End
--------------------------------------------------------

What do you think about that?

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190909/220f73d3/attachment.sig>


More information about the User mailing list