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=1.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1fd537a3da8a5021 X-Google-Attributes: gid103376,public From: "Ken Garlington" Subject: Re: Array access via pointer? Date: 2000/08/03 Message-ID: <813i5.1869$SB4.159422@news.flash.net>#1/1 X-Deja-AN: 653821027 References: <398721AD.CAEE3A51@home.com> <8m7hn1$i4r$1@nnrp1.deja.com> <3988269B.D1DB4EA5@home.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 965262532 216.215.65.162 (Wed, 02 Aug 2000 19:28:52 CDT) Organization: FlashNet Communications, http://www.flash.net X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 02 Aug 2000 19:28:52 CDT Newsgroups: comp.lang.ada Date: 2000-08-03T00:00:00+00:00 List-Id: "Michael Carman" wrote in message news:3988269B.D1DB4EA5@home.com... [snip] > My example was simplified to illustrate the problem I was having. > Unfortunately, it oversimplified the situation a bit. I wasn't passing > in a pointer to an array just for fun. I determine which array to > process in a completely seperate part of the program. [snip] > [To further complicate things, I can't use 'Access -- I'm trying to keep > my code Ada83 compatible -- I know how to work around it, it's just > messier.] Well, the Ada95 approach using 'Access is certainly much easier, but if you have to stick with Ada83, IIRC we had some luck with the following: --- with System, Unchecked_Conversion; package Address_Fun is type Addr_Table_Values is array (Natural range <>) of System.Address; -- First, Last can be changed to Length if desired type Addr_Table (First, Last: Natural) is record Values: Addr_Table_Values(First .. Last); end record; type Addr_Table_Access is access Addr_Table; function To_Addr_Table_Access is new Unchecked_Conversion (System.Address, Addr_Table_Access); procedure Foo (Table: in Addr_Table_Access; I: in Integer); end Address_Fun;