comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Strings and reading from a file
Date: 1999/05/12
Date: 1999-05-12T00:00:00+00:00	[thread overview]
Message-ID: <7hc3k8$6ft$1@nnrp1.deja.com> (raw)
In-Reply-To: 7hbnnl$rca$1@nnrp1.deja.com

In article <7hbnnl$rca$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-dejanews.com> wrote:
> In article <7han2q$jkp$1@news.iinet.net.au>,
>   "Cameron Hodge" <vampyre@ozemail.com.au> wrote:
> > 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.
>
> So, keep track of these lengths! Simple enough logic to do that.

In case you don't understand how this helps, you should know that you
can pass just *part* of a string (or any array for that matter) to a
subroutine. Assume your 20 character string is named "My_String" and you
have its length stored in "My_String_End":

Ada.Text_IO.Put_Line ( My_String(1..My_String_End) );



--
T.E.D.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---




      parent reply	other threads:[~1999-05-12  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
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             ` 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-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-15  0:00             ` jrcarter001
1999-06-05  0:00               ` Matthew Heaney
1999-05-12  0:00   ` dennison [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox