[Gambas-user] prb:Left() does not work correct.

Ron Onstenk ronstk at ...239...
Fri Jun 16 00:42:51 CEST 2006


On Thursday 15 June 2006 23:00, Benoit Minisini wrote:
> On Tuesday 09 May 2006 02:56, ron wrote:
> > On Monday 08 May 2006 22:23, Benoit Minisini wrote:
> > > Can you send me your project, or better, can you isolate the bug and send
> > > me a stripped project that reproduce the bug?
> > >
> > > Thanks in advance.
> > >
> > > Regards,
> >
> > Ok here it is in very stripped form
> > On the bottom of the form is told what to do.
> >
> > Happy programming,
> >
> > Ron
> 
> Is this problem fixed?
> 
No, The problem is in 1.9.32 still there.

I have redone the sample to try make it more clear.

If the tag used for Left(control.tag) is not the
.tag of the FIRST control on the form the .tag value is not taken.
And all other tags of remaining controls too.
 

PUBLIC FUNCTION Init(parent AS Form) AS Boolean
DIM idx AS Integer
DIM frm AS Form
DIM ctrl AS Control
DIM t AS String

txtResult = ""

  frm = parent
  FOR EACH ctrl IN frm.Children
    PRINT ctrl.Tag
    
IF UseTmpString = TRUE THEN    

    t = ctrl.tag  
    IF Left(t, 4) = "bind" THEN '<--------------- this works YES
      checktag(ctrl)  
    END IF  

ELSE

    IF Left(ctrl.tag, 4) = "bind" THEN '<-------- this works NOT
      checktag(ctrl)  
    END IF  
    
END IF
    
  NEXT
  RETURN TRUE
    
END

Sorry but the .Tag is not always save to use.


Ron


-------------- next part --------------
A non-text attachment was scrubbed...
Name: lefttest.tar.bz2
Type: application/x-tbz
Size: 5001 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060616/a05d6112/attachment.bin>


More information about the User mailing list