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

Benoit Minisini gambas at ...1...
Mon Apr 24 00:39:15 CEST 2006


On Sunday 23 April 2006 23:29, ron wrote:
> gb2-1.9.28
>
> In the tag of some controls on my form is a string as
> "bind:fld=mykey"
>
> PUBLIC FUNCTION Init(parent AS Form) AS Boolean
> DIM idx AS Integer
> DIM frm AS Form
> DIM ctrl AS Control
>
>   frm = parent
>   FOR EACH ctrl IN frm.Children
>     PRINT ctrl.Tag 'shows correct tag message
>     PRINT Left(ctrl.tag, 4) 'gets the required text
>     IF Left(ctrl.tag, 4) = "bind" THEN ' <-- skips
>       checktag(ctrl)  ' <---never called
>     END IF
>   NEXT
> END
>
> PUBLIC FUNCTION Init(parent AS Form) AS Boolean
> DIM idx AS Integer
> DIM frm AS Form
> DIM ctrl AS Control
> DIM t AS String
>
>   frm = parent
>   FOR EACH ctrl IN frm.Children
>     PRINT ctrl.Tag
>     t = Left(ctrl.tag, 4)
>     PRINT t
>     IF t = "bind" THEN ' works
>       checktag(ctrl)  ' <-- is now done
>     END IF
>   NEXT
> END
>
> As far I know should Left(ctrl.tag, 4) return a string type.
> Change to Left$(ctrl.tag, 4) also did not work
> After a try with second code block that did work I try
> with Cstr(Left$(ctrl.tag, 4)) and it works.
>
> I asume mid() left() and right() shouls give me a string?
> Using the left$() even did not. Something wrong here?
>
>

I cannot reproduce your bug. Can you try with 1.9.29 ?

Regards,

-- 
Benoit Minisini





More information about the User mailing list