A Question, no two Questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

A Question, no two Questions

Karl Reinl
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: A Question, no two Questions

Pablo Vera
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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>


-------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user