From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,68f91dde523dad6c,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Stefan Merwitz Newsgroups: comp.lang.ada Subject: Input a string (again) Date: Sat, 29 Jan 2005 09:55:02 +0100 Message-ID: <36119gF4r0h1aU2@individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net eq7x7dLT/o1dMylm/orYJAFz/i/ejULyGQxA0l68DocfVoQngJ User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Xref: g2news1.google.com comp.lang.ada:8059 Date: 2005-01-29T09:55:02+01:00 List-Id: Hello everybody, I'm nearly at despairing. After I'm now able to input a string (30 chars), I need to cancel the loop in the following source, when the user enters an empty line: function InputString return string is sString: String(1..30); -- constrained iString_Length: Natural range 0..sString'Last; begin Skip_Line; Get_Line(sString, iString_Length); if iString_Length = sString'Last then Skip_Line; end if; return sString; end; bContinue: boolean := true; begin while bContinue loop sHobbyStr := InputString; if Trim(To_Unbounded_String(sHobbyStr), Both) = "" then bContinue := false; else Put(sHobbyStr); end if; end loop; end; But unfortunately, neither Trim(To_Unbounded_String(sHobbyStr), Both) = "" nor sHobbyStr = " " (30 empty chars) work. All I want is to cancel that loop when nothing is entered, help! Could you please help me, Stefan