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

Benoit Minisini gambas at ...1...
Wed Jun 28 18:09:24 CEST 2006


On Friday 16 June 2006 00:42, Ron Onstenk wrote:
> 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

I finally found the bug and fixed it. It was the "=" and '<>' operators that 
sometimes did bad things when comparing strings.

Strange that you are the only people having problems!

Here is a patch for 1.9.32.

Regards,

-- 
Benoit Minisini
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gbx_subr_test.c
Type: text/x-csrc
Size: 9321 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060628/d1590c9f/attachment.c>


More information about the User mailing list