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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,15480fcd593513b9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 24 Sep 2009 08:59:07 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Table of pointers question References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4abb18bc$0$30225$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 24 Sep 2009 08:59:08 CEST NNTP-Posting-Host: da3e085f.newsspool1.arcor-online.net X-Trace: DXC=d@3EH]6^O^5]E=H1Q9`787ic==]BZ:af>4Fo<]lROoR1^YC2XCjHcb9T@UTC2<>ER5A:ho7QcPOV3]:T8F@RoX::h`]5nVU4GH> X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8453 Date: 2009-09-24T08:59:08+02:00 List-Id: Rob Solomon wrote: > I am working my way thru Ada As A Second Language by Norman Cohen (c) > 1996 > > This confuses me. > > It is a simple sorting routine that swaps pointers rather than the > data. Note that the variables are more like Modula-2 syntax as I am > very comfortable with that. And it is easier to type. Has something gone wrong when (I'm guessing here) the program was rewritten for Ada? The compiler shows some errors. After correcting these formally, i.e. without thinking, it confirms Adam's observation, and hints to others: Compiling: printdirectory.adb (source file time stamp: 2009-09-24 06:42:50) 25. EntryList : array (1..MaxEntries) of DirectoryEntryType; | >>> warning: variable "EntryList" is not referenced 33. NewEntry.NamePart := To_Bounded_String(Buffer(1..Length)); | >>> warning: "NewEntry" may be null Here, the "correction" was 1 - END IF; -- semicolon, not colon ... 2, 3 - EntryPointerList(NumberOfEntries) := -- *new* DirectoryEntry*Pointer*Type'(NewEntry); -- MY QUESTION HERE (NewEntry is of a pointer type already.) Maybe the intent is that EntryList should privide storage for new directory entries, as mentioned in other postings? No "new" then, but putting pointers to the entries in EntryList into EntryPointerList. I guess that NewEntry should stand for one of the components of EntryList during each loop. Side note: A good source code editor will remove the burden of having to press the shift key for capital letters: whenever you press '_' or ' ' or ':' etc, the preceding identifier will, by default, be adjusted to your casing preferences. They should be easy to type then.