Re: Get_Line
Preben Randhol <[email protected]> Wed, 26 Feb 2003 13:47:56 +0100
| Newsgroups | gmane.comp.lang.ada.sockets |
|---|---|
| Organization | PVV |
| Message-ID | <[email protected]> |
Martin Persson <[email protected]> wrote on 26/02/2003 (13:00) : > Is there a design reason why Get_Line in AdaSockets is a function and > not comformant with the standard Get_Line for strings which is a procedure? > > One of the problems with a function arises when one stores the result in > a string and wants to find out the real length of the line (without > using Unbounded or similar solutions). This is dealt with in > Ada.Text_IO.Get_Line by returning the string and the real length via out > parameters. whats wrong with: declare Result : = Get_Line (Some_Socket); begin Length := Result'Length end; -- Preben Randhol ---------------- http://www.pvv.org/~randhol/ -- "Violence is the last refuge of the incompetent", Isaac Asimov _______________________________________________ AdaSockets mailing list [email protected] http://www.rfc1149.net/mailman/listinfo/adasockets