"Wesley Groleau" a �crit dans le message news: evacnf433pJrU4uiXTWJgA@gbronline.com... > Preben Randhol wrote: > > I sometimes use this procedure: > > > > procedure Get_Whole_Line > > (File : in File_Type; > > Item : out String; > > Last : out Natural) > > is > > I often use a function, which reads > from the file into a temporary, > and then returns Temp (1 .. Last) > > The difficulty is knowing how big to make > the temporary. > This one reads a line with no length limit: function Get_Line return String is Buffer : String (1..500); -- or whatever Last : Natural; begin Get_Line (Buffer, Last); if Last < Buffer'Last then return Buffer (1..Last); else return Buffer & Get_Line; end if; end Get_Line; In most cases, there will be only one call, while having no upper limit. The size of the buffer is just a matter of optimization. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr