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,d93b7c6dd17cbc81,start X-Google-Attributes: gid103376,public From: David Botton Subject: Re: Strings and reading from a file Date: 1999/05/11 Message-ID: <3738E40B.59222659@Botton.com>#1/1 X-Deja-AN: 476837147 Content-Transfer-Encoding: 7bit References: <7han2q$jkp$1@news.iinet.net.au> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@gate.net X-Trace: news.gate.net 926475270 112058 199.227.35.216 (12 May 1999 02:14:30 GMT) Organization: CyberGate, Inc. Mime-Version: 1.0 NNTP-Posting-Date: 12 May 1999 02:14:30 GMT Newsgroups: comp.lang.ada Date: 1999-05-12T02:14:30+00:00 List-Id: Take a look at the package Ada.Strings.Unbounded in the RM A.4.5 David Botton Cameron Hodge wrote: > > Hey guys and girls > > I know this is pretty simple but I have to read some strings in from a file. > I have declared the type to be > > Firstname : String of length 1..20 > > I can read the string in fine, no probs there, but if the string is under > the 20 characters I get rubbish in the remaining string positions. Now I got > around this by assigning firstname := " <20 spaces>" however when I now > display this string to the screen, it displayes the full 20 characters. How > to do I remove the training Space's ???? > > Now I know I get the length of the string when I read it in and can declare > the varialle there and then, but I am reading in many strings all of > different lengths into an array. > > hmm I hope everyone can understand this. > > Thanks > > vampyre@ozemail.com.au