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

PICCORO McKAY Lenz mckaygerhard at gmail.com
Fri Jul 6 22:38:14 CEST 2018


thanks, now works, maybe in the wiki we need those little pieces of code!

but quite strange, after coupe of hours today trying machine said
"cannot start out of memory" at the gambas ide!
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com


2018-07-06 16:17 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
> It doesn't make any difference whether it is control or not. Controls are
> objects. The code Vuott already showed will work. The symbol "symbols" is in
> the class class, not in the object.
> If you want to return class of an object, you do it this way:
>
> Dim cl As Class
> Dim s As String
>
>   cl = Object.Class(hYourObject)
>
>   For Each s In cl.Symbols
>     Print s
>   Next
>
>
>
> Jussi
>
> On Fri, Jul 6, 2018 at 11:05 PM, PICCORO McKAY Lenz <mckaygerhard at gmail.com>
> wrote:
>>
>> but i already have a object parsed from another .. its nonsense if i
>> cannot applied to a control or autodetect a control!
>>
>> or well how to detect if a already passed control from another calss
>> to a module that checks if a text are empty?  on their respoective
>> Text symbol if there any ?
>> Lenz McKAY Gerardo (PICCORO)
>> http://qgqlochekone.blogspot.com
>>
>>
>> 2018-07-06 15:46 GMT-04:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
>> > You haven't declared the "cl" as class, as Vuott advice you to do,
>> >
>> >
>> > Jussi
>> >
>> > On Fri, Jul 6, 2018 at 10:40 PM, PICCORO McKAY Lenz
>> > <mckaygerhard at gmail.com>
>> > wrote:
>> >>
>> >> dont work, said: Unkown symbol "symbols"
>> >>
>> >> it's a control! i must detect first if the object its a control! how to
>> >> do?
>> >>
>> >>
>> >> Lenz McKAY Gerardo (PICCORO)
>> >> http://qgqlochekone.blogspot.com
>> >>
>> >>
>> >> 2018-06-27 19:09 GMT-04:00  <vuott at tiscali.it>:
>> >> > Why do not you try them ?  :-)
>> >> >
>> >> > Il 27.06.2018 21:24 PICCORO McKAY Lenz ha scritto:
>> >> >
>> >> > 2018-06-27 14:51 GMT-04:00 <vuott at tiscali.it>:
>> >> >>
>> >> >>   cl = Class.Load("Button")
>> >> >
>> >> > umm i assumed that cl it's equal to my already passed object a
>> >> > argument
>> >> > right?
>> >> >
>> >> >
>> >> >>
>> >> >>
>> >> >>   For Each s In cl.Symbols
>> >> >>     Print s
>> >> >>   Next
>> >> >
>> >> > so then one of thos will print "Text" i guess?
>> >> >
>> >> >
>> >> >>
>> >> >> + + + + + + + + +
>> >> >> vuott
>> >> >>
>> >> >> Il 27.06.2018 19:25 PICCORO McKAY Lenz ha scritto:
>> >> >>
>> >> >> 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 '
>> >> >> Return "is empty"
>> >> >>         Endif
>> >> >>     Endif
>> >> >>
>> >> >>     Return "is not empty? could not detect any input text"
>> >> >> end
>> >> >>
>> >> >>
>> >> >> Lenz McKAY Gerardo (PICCORO)
>> >> >> http://qgqlochekone.blogspot.com
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> Con MyOpen hai Giga, SMS e i minuti che vuoi da 3€ al mese, per
>> >> >> sempre.
>> >> >> Cambi gratis quando e come vuoi e in più hai 10€ di credito omaggio!
>> >> >> SCOPRI DI PIU’ http://tisca.li/MailHPMobile
>> >> >>
>> >> >>
>> >> >>
>> >> >> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>> >> >> ]----
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > Con MyOpen hai Giga, SMS e i minuti che vuoi da 3€ al mese, per
>> >> > sempre.
>> >> > Cambi gratis quando e come vuoi e in più hai 10€ di credito omaggio!
>> >> > SCOPRI DI PIU’ http://tisca.li/MailHPMobile
>> >> >
>> >> >
>> >> >
>> >> > ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>> >> > ]----
>> >> >
>> >>
>> >> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net
>> >> ]----
>> >
>> >
>> >
>> >
>> > ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>> >
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
>
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>


More information about the User mailing list