[Gambas-devel] Qt component / Segmentation fault

Laurent Carlier lordheavy at ...141...
Mon Jan 3 11:44:30 CET 2005


Le Lundi 3 Janvier 2005 11:21, Daniel Campos a écrit :
> Hi:
>
> Create a project with a Button and a TextBox. Insert the following code
> into the button "click" event:
>
> PUBLIC SUB Button1_Click()
>
>   TextBox1.Pos=-4
>   TextBox1.Insert("Hola")
>
> END
>
> After pressing Button1, a segmentation fault finishes the program.
>
> Regards,
>
> D. Campos
>
Because it must be an unsigned value. Here you should do :
TextBox1.Pos= TextBox1.Pos - 4

Currently it seems that -4 is converted to an unsigned value so going "out of 
range" of the text -> segfault !

Regards,

-- 

Laurent Carlier




More information about the Devel mailing list