[Gambas-user] Arrays again

tobias tobiasboe1 at ...20...
Mon Sep 12 23:09:52 CEST 2011


On 12.09.2011 22:20, Dag-Jarle Johansen wrote:
> Hi,
>
> I am feeling a little stupid, but I just can't make this running:
>
> Public xxx As Control (or Public xxx As Object)
>
> public sub ChangeControls()
>          DIM I as integer
>          For I = 0 To mTrans.LoginCount - 1
>              For Each xxx In Me.Children
>                  Debug xxx.Name
>                  If xxx.Name = mTrans.TNLoginName[I] Then
>                      xxx.Text=mTrans.TNLogin[I]
>                  Endif
>              Next
>          Next
>
> TNLoginName[] and TNLogin[] are predefined arrays, and seem to work.
> In the Debug xxx.Name nothing happens, and the control XXX can not have a
> text, though Tooltip is possible,
> If I define xxx as Object I can have a Text, but not a Tooltip.
>
> At the moment nothing really works, and as I am a extrem database-fan, I
> would like to manipulate every given object as far as possible.
> I am pretty sure I have misunderstood something here, so please help me.
>
> Thanks in advance, regards
> Dag-Jarle
the debug instruction only works if compiled with debugging information 
(as the documentation states), i hope, this is the case?
why don't use Print or if it has to be stderr, Error?
however, things like this (iterating through container children and 
changing attributes) normally work for me, if the strings in the array 
match the names of the controls? i quite can't imagine why there is a 
difference between using xxx As Control and As Object but i never tried 
using As Control...




More information about the User mailing list