[Gambas-user] A Question, no two Questions

Pablo Vera pvera at ...729...
Mon Sep 12 15:04:57 CEST 2005


Use the Object.Class function, like this:

'-----------------------------------------------------------------------------------

PUBLIC FUNCTION GetControlTyp(c AS Control) AS String
DIM sRet AS String
     sRet = Object.Class(c)
     RETURN sRet
END

'-----------------------------------------------------------------------------------

PUBLIC FUNCTION GetFormName(f AS Object) AS String
DIM sRet AS String
     sRet = Object.Class(f)
     RETURN sRet
END

'-----------------------------------------------------------------------------------

Saludos,
Pablo Vera

Charlie Reinl wrote:
> 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
> '-----------------------------------------------------------------------------------
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 
> 




More information about the User mailing list