[gtkada] simple gtk_editable question

Michal Nowikowski godfryd at zamek.gda.pl
Wed Jan 9 09:45:48 CET 2002


              You "Clark, G L" <g.l.clark at lmco.com> who had written:

>  I'm getting a Constraint error when trying to read the characters from
>  an editable field into a bounded string.

> subtype NAME_TYPE is string(1..40);
> ...
> --(Name is of type NAME_TYPE)
> FORM_DATA.NAME := get_chars(Create_Database_Dialog.New_Database_Entry);

because get_chars(Create_Database_Dialog.New_Database_Entry) can return 
another amount of chars than 40

You could do sth like this

declare
   name : String := get_chars(Create_Database_Dialog.New_Database_Entry);
begin
   ...
end;

or

FORM_DATA.NAME :=
get_chars(Create_Database_Dialog.New_Database_Entry)(1..40);

Godfryd

-- 
|  Michal Nowikowski <godfryd at zamek.gda.pl>
|  wymówka admina #268:
|  Neutrino overload on the nameserver




More information about the gtkada mailing list