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, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,49f7dd1bad1910ff X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-14 09:45:49 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!53ab2750!not-for-mail From: "Stephane Richard" Newsgroups: comp.lang.ada References: <8336eb21.0310131423.7410e1ec@posting.google.com> <8336eb21.0310140439.393f2e8@posting.google.com> Subject: Re: Problems with Ada.Text_IO and strings. (wants EOL character) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <0LVib.10926$zw4.6226@nwrdny01.gnilink.net> Date: Tue, 14 Oct 2003 16:45:48 GMT NNTP-Posting-Host: 141.149.80.175 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1066149948 141.149.80.175 (Tue, 14 Oct 2003 12:45:48 EDT) NNTP-Posting-Date: Tue, 14 Oct 2003 12:45:48 EDT Xref: archiver1.google.com comp.lang.ada:839 Date: 2003-10-14T16:45:48+00:00 List-Id: > I missed your original post; what was your problem? Does Get_Line > solve it? > -- > -- Stephe Here's that original Post Steph :-) ------------------------------------------------------------------------ Hi, im new to Ada and I am writing my first program trying to "get" Ada. My small program ask for input from the user. I read it using : Ada.Text_IO.Get_Line (MyType.Name, NameLength); This data is then stored inside an array of a type I have declared : type MyType is record name : string(1..20); adress : string(1..40); telephone : natural; end record; Later in the program I output this information using : Ada.Text_IO.Put (MyType.name); My problem is this : when I output the name, part of the string is filled with "garbage" characters. If I fill the string with 20 characters I get no garbage. But when I write a name that's about 10 characters long, I get about 10 characters of garbage. Im using Gnat as my Ada compiler if that makes a difference. Any help would be appreciated. Thank you in advance. ------------------------------------------------------------------- Stephane Richard "Ada World" webmaster http://www.adaworld.com