From: David Botton <David@Botton.com>
Subject: Re: Strings and reading from a file
Date: 1999/05/11
Date: 1999-05-12T02:14:30+00:00 [thread overview]
Message-ID: <3738E40B.59222659@Botton.com> (raw)
In-Reply-To: 7han2q$jkp$1@news.iinet.net.au
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
next prev parent reply other threads:[~1999-05-11 0:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-05-12 0:00 Strings and reading from a file Cameron Hodge
1999-05-11 0:00 ` David Botton [this message]
1999-05-12 0:00 ` Gautier
1999-05-12 0:00 ` Robert Dewar
1999-05-12 0:00 ` Cameron Hodge
1999-05-12 0:00 ` David C. Hoos, Sr.
1999-05-12 0:00 ` Marin David Condic
1999-05-12 0:00 ` Tom Moran
1999-05-12 0:00 ` Marin David Condic
1999-05-13 0:00 ` jrcarter001
1999-05-13 0:00 ` dennison
1999-05-13 0:00 ` Martin C. Carlisle
1999-05-13 0:00 ` Marin David Condic
1999-05-13 0:00 ` Hyman Rosen
1999-05-13 0:00 ` Keith Thompson
1999-05-14 0:00 ` Pascal Obry
1999-05-13 0:00 ` David Botton
1999-05-13 0:00 ` David Botton
1999-05-14 0:00 ` Jean-Pierre Rosen
1999-05-14 0:00 ` Keith Thompson
1999-05-14 0:00 ` David C. Hoos, Sr.
1999-05-14 0:00 ` Keith Thompson
1999-05-15 0:00 ` David C. Hoos, Sr.
1999-05-16 0:00 ` Jean-Pierre Rosen
1999-05-15 0:00 ` jrcarter001
1999-06-05 0:00 ` Matthew Heaney
1999-05-12 0:00 ` dennison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox