[Gambas-user] how to detect if a class has a .text property?

PICCORO McKAY Lenz mckaygerhard at gmail.com
Wed Jun 27 19:25:55 CEST 2018


in the following code i want to detect independent of the type if the ref
obj has a input text field and are empty..

how can i do that?

Public Function required(objinput As Variant) As Variant

    If TypeOf(objinput) = gb.String Then
        If Comp(objinput, "", gb.IgnoreCase) = 0 Then
            Return "is empty"
        Endif
    Endif

    If TypeOf(objinput) = gb.Class Then
        If Comp(objinput.Text, "", gb.IgnoreCase) = 0 Then ' <--- here the
problem!!!!
            Return "is empty"
        Endif
    Endif

    Return "is not empty? could not detect any input text"

end


Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180627/ef8fc301/attachment-0001.html>


More information about the User mailing list