"Robert Spooner" a �crit dans le message news: bf9crp$18rg$1@f04n12.cac.psu.edu... > I tried this using the following program and gnat version 3.13p on > windows professional 2000 with the following result: > > with Ada.Text_IO; > > procedure No_String_Length_Limit_Test is > > package Tio renames Ada.Text_IO; > > > function Get_Line (Buffer_Size : Positive := 1) return String is > Buffer : String (1..Buffer_Size); > Last : Natural; > begin > Tio.Get_Line (Buffer, Last); > if Last < Buffer'Last then > return Buffer(1..Last); > else > return Buffer & Get_Line (2*Buffer_Size); > end if; > end Get_Line; > > > begin -- No_String_Length_Limit_Test > > loop > Tio.Put ("Enter a message, to exit: "); > declare > The_Message : String := Get_Line; > begin > exit when The_Message'Length = 0; > Tio.Put_Line ("The message is " & The_Message); > end; > end loop; > > end No_String_Length_Limit_Test; > > no_string_length_limit_test.adb:16:26: ambiguous operand for concatenation > no_string_length_limit_test.adb:16:26: possible interpretation at line 8 > Done--error detected. > > Can someone tell me why the operand is ambiguous? > Because there are two possible meanings :-) 1) return the catenation of Buffer with the result of the call to Get_Line with (2*Buffer_Size) as a parameter (what you intended). 2) return the catenation of Buffer with the single character obtained by indexing the result of the call to Get_Line (with the default paramater) by the index value (2*Buffer_Size). No Gnat bug here! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr