[Gambas-user] how to write text in indexed list of labels

Bruce adamnt42 at gmail.com
Mon Sep 7 19:28:15 CEST 2020


On 7/9/20 11:21 pm, Jussi Lahtinen wrote:
> That's weird... if you try it with simple form and a label, this prints:
> Print Object.Type(Me["Label1"])
> Label
> 
> But when you try to use it, it's control... I don't think there should be a
> cast to other types.
> Benoit?
> 
> 
> Jussi
> 
> 
> 

Look at it this way
Print TypeOf(Me["Label1"])
16  (=gb.Object)
OK! It is an object so I can do Object "stuff" with it. Like looking at 
Object.Type
BUT if you read every word of the help for Object.Type
"Returns the class name of an object."
Object.Type(Me["Label1"]) is just rerturning a string which is the Name 
of the class of which Me["Label1"] is an instance --- but it is still an 
object not a Label!

:-) It's good fun isn't it!
b


More information about the User mailing list