From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: questions on input/output Date: Sat, 6 Feb 2021 08:21:49 +0100 Organization: Adalog Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 6 Feb 2021 07:21:48 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="e923749a96f88e7ab5735cb2d1040b7a"; logging-data="20205"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WxVSxvuz9ZeWtZ0rMzH+l" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 Cancel-Lock: sha1:oJrg0urneHkjf7wCXX5m8q3i2yg= In-Reply-To: Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:61294 List-Id: Le 06/02/2021 à 01:59, Mehdi Saada a écrit : > I had no idea input/output was that cumbersome ! It is not, but you have to understand the logic behind it, which might be different from what you know from other languages. For example, Text_IO is compatible with keyboards, async lines, etc. What would backspacing mean on these? And Ada has nice features to make your life easier, especially the ability to have dynamically size arrays. If you want a full line and don't want to care with the length, just do the following: declare Line : String := Get_Line; begin -- do what you need to do end; This will reserve exactly the right size for Line, no possibility of buffer overflow, and no wasted space. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr