Re: Initialiser une chaine de taille contrainte.

Pascal <[email protected]>
Newsgroups gmane.comp.lang.ada.france
Message-ID <[email protected]>
Merci pour vos réponses.

Je faisais effectivement une confusion entre une valeur chaine "toto" équivalente à un tableau et une valeur caractère '$' qui ne peuvent donc pas être au même niveau avec Ada.

J'ai alors créé cette fonction :
  function To_Fixed_String
    (Size   : Positive; Source : String)
     return   String
  is
     Fixed_Source : String (1 .. Size);
  begin
     Ada.Strings.Fixed.Move (Source => Source, Target => Fixed_Source);
     return Fixed_Source;
  end To_Fixed_String;

d'où :
  type TTabChaine is array (1 .. 2) of String (1 .. 13);
  Noms3_OK : constant TTabChaine :=
    (To_Fixed_String (13, "F12.txt"),
     To_Fixed_String (13, "gnat.exe"));

Meilleurs voeux 2012, Pascal.
http://blady.pagesperso-orange.fr


_______________________________________________
Site WWW de l'association Ada-France: http://www.ada-france.org/
[email protected]
http://www.ada-france.org/mailman/listinfo/ada-france
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.