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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d93b7c6dd17cbc81 X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Strings and reading from a file Date: 1999/05/12 Message-ID: <3739EDC5.6AFFF900@pwfl.com>#1/1 X-Deja-AN: 477158517 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <7han2q$jkp$1@news.iinet.net.au> <7hbnnl$rca$1@nnrp1.deja.com> <7hc358$ha5$1@news.iinet.net.au> <37399913.BD928DD1@pwfl.com> <3739ce9a.5858380@news.pacbell.net> Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada Date: 1999-05-12T00:00:00+00:00 List-Id: 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