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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ed1f845799e1cd8 X-Google-Attributes: gid103376,public From: John J Cupak Jr Subject: Re: Problems with Last statment .... Date: 2000/03/14 Message-ID: <38CE7AD7.7A111DC0@res.raytheon.com>#1/1 X-Deja-AN: 597423138 References: <38ce6681.0@news.per.paradox.net.au> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------A5912B1191059D039CE6127D" X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 953055965 138.127.184.129 (Tue, 14 Mar 2000 12:46:05 EST) Organization: Raytheon Company MIME-Version: 1.0 NNTP-Posting-Date: Tue, 14 Mar 2000 12:46:05 EST Newsgroups: comp.lang.ada Date: 2000-03-14T00:00:00+00:00 List-Id: This is a multi-part message in MIME format. --------------A5912B1191059D039CE6127D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I hear about this problem quite a bit from my Ada students. Reading/Writing fixed-length strings: Get_Line(Name, Last); -- Reads 0..Last number of characters into Name string Put (Name(1..Last)); -- Put ONLY characters just read to output! Hope this helps! Yours in Ada, John Defiant wrote: > hi im writing a program for a uni assignment and it is complete and works > yet i have set the string type to a min of 1 to a max of 20 characters for a > name input... > > the problem i am having is i am using the Get_Line(Name, Last) statement to > get the name they feed in and the Put(Name); procedure to output... the > problem is ada compiler grabs whatever extra numerals hex and garbage that > is left in RAM to fill the extra places between 1 and 20... that the name > that was input doesnt fill .... > > any suggestions ... > > Thanks --------------A5912B1191059D039CE6127D Content-Type: text/x-vcard; charset=us-ascii; name="John_J_Cupak.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for John J Cupak Jr Content-Disposition: attachment; filename="John_J_Cupak.vcf" begin:vcard n:Cupak Jr;John J tel;fax:978.858.4336 tel;work:978.858.1222 x-mozilla-html:TRUE org:Raytheon Company;Northeast Software Training version:2.1 email;internet:John_J_Cupak@res.raytheon.com title:Software Engineering Instructor adr;quoted-printable:;;50 Apple Hill Road=0D=0AT3MN35;Tewksbury;MA;01876;USA x-mozilla-cpt:;9904 fn:John J Cupak Jr end:vcard --------------A5912B1191059D039CE6127D--