[Gambas-user] FINALLY PROBLEM IN GAMBAS2

Charlie Reinl Karl.Reinl at ...9...
Fri Jul 31 21:59:02 CEST 2009


Salut,

am I the only who have problems with FINALLY in Error-Case with CATCH.

If open DB (mysql), in case of an wrong password 
FINALLY is executed before CATCH.

In that SUB

PUBLIC SUB btnOK_Click()
DIM sDB AS String
    IF cboHost.text = "" THEN
        cboHost.text = "localhost" ' is default
    ENDIF
    TRY crmConn.Close
    ME.enabled = FALSE
    WITH crmConn
        .Type = "mysql"
        .Host = cboHost.Text
        .Login = txtUser.Text
        .Password = txtPW.Text
        .Open
        sDB = GetDataBase(Main.MyConfig["CRMDatabase", "CRM2"])
        IF sDB <> "" THEN
            Main.MyConfig["CRMDatabase"] = sDB
            ME.Close()
        ENDIF
    END WITH
FINALLY
    txtPW.Text = ""
    'gb2 ME.enabled = TRUE
CATCH
    Message.Error(Replace(Error.Text, ".", "." & gb.NewLine))
END

gambas2.15.2 

-- 
Amicalment
Charlie





More information about the User mailing list