comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.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: <3739EDC5.6AFFF900@pwfl.com> (raw)
In-Reply-To: 3739ce9a.5858380@news.pacbell.net

Tom Moran wrote:
> 
> >you get the length as one of the returned
> >parameters
> Actually, you get the last index, which is numerically equal to the
> length in the particular case that the first index is 1.  It's a
> dangerous habit to start assuming Last = Length.

Quite right and maybe I should be more careful when using examples such
as this when the unknown feature being explained is the issue. I'd
rather assume that an experienced Ada programmer writing a "general
purpose" string handling routine would know enough not to do that, yet
get away with it in instances that are as nicely isolated as my little
example. (I guess I get sloppy with definitions because by nature I hate
to sweat the details! :-)

Of course, if the string had been defined as, say, String (301..556),
then we'd be looking at "Last" not representing the "Length" of the
string, but of the last used cell of the array. So let the student
beware when listening to my advice!

MDC
-- 
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.flipag.net/mcondic




  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 ` Robert Dewar
1999-05-12  0:00   ` dennison
1999-05-12  0:00   ` Cameron Hodge
1999-05-12  0:00     ` Marin David Condic
1999-05-12  0:00       ` Tom Moran
1999-05-12  0:00         ` Marin David Condic [this message]
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     ` David C. Hoos, Sr.
1999-05-12  0:00 ` Gautier
replies disabled

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