[Gambas-user] A Question, no two Questions

Charlie Reinl Karl.Reinl at ...9...
Mon Sep 12 00:12:14 CEST 2005


Salut,

I need to know in a commen Function, what is the type of the control, I work 
with (see GetControlTyp ) .
I need to know, if it is a TextBox , a ComboBox or what ever.

My way will work till the day, where Benoit changes the Error.Text.

I have the same pb. to get the Forms name ( see GetFormName)

Any better solutions ?

Amicalment
Charlie

'-----------------------------------------------------------------------------------
PUBLIC FUNCTION GetControlTyp(c AS Control) AS String
DIM sRet AS String
DIM CC AS Component
    CC = c
CATCH
    sRet = Upper(Error.Text)
    sRet = Mid(sRet ,Instr(sRet,"GOT"))
    sRet = Trim(Replace(sRet, "GOT",""))
    sRet = Trim(Replace(sRet, "INSTEAD",""))
    RETURN sRet
END
'-----------------------------------------------------------------------------------
PUBLIC FUNCTION GetFormName(f AS Object) AS String
DIM sRet AS String
    sRet = f.Hurga
CATCH
    sRet = Upper(Error.Text)
    sRet = Mid(sRet ,Instr(sRet,"CLASS") + 5 )
    sRet = Trim(Replace(sRet, "'",""))
    RETURN sRet
END
'-----------------------------------------------------------------------------------




More information about the User mailing list