[gtkada] string CONSTRAINT_ERRORS problems (2)

Thomas De Contes d.l.deContes at iFrance.com
Mon Apr 1 20:02:49 CEST 2002


Le lundi 1 avril 2002, à 07:09 , Jacobo Marcos a écrit :

>
>    ---------------------------------
>    -- On_Boton_Introducir_Clicked --
>    ---------------------------------
>
>    procedure On_Boton_Introducir_Clicked
>      (Object : access Gtk_Button_Record'Class)
>    is
>       I: GInt;
>       Mi_Texto: String(1..25):= (others=> ' ');
>    begin
>           Mi_Texto(1..25):= Get_Text(Ventana_Ppal.Entrada); --raised

do you know unbounded strings ? i think it's adapted to your problem

if you write
Mi_Texto(1..20):= Get_Text(Ventana_Ppal.Entrada);
you must be sure that Get_Text returns String(1..20), not only String
Mi_Texto:= Get_Text(Ventana_Ppal.Entrada);
you must be sure that Get_Text returns String(1..25), because "Mi_Texto: 
String(1..25);"

do you understand why Mi_Texto(1..3) := "uno"; is right ?





More information about the gtkada mailing list