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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f5c6fba20eff3d07 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Pointer to Array Date: Tue, 16 Oct 2007 10:16:30 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1192542030.745091.64900@q5g2000prf.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1192544190 4915 192.74.137.71 (16 Oct 2007 14:16:30 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 16 Oct 2007 14:16:30 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:sPJkQnRG+pFPqKfQ2Per0bWL6D8= Xref: g2news2.google.com comp.lang.ada:2465 Date: 2007-10-16T10:16:30-04:00 List-Id: shaunpatterson@gmail.com writes: > -- system 1 > type INT_ARRAY is new Integer (1..SYSTEM_1_SIZE); > > Int_Array_Var : INT_ARRAY; The above doesn't seem right -- not sure what you really meant. > if usingSystem1 then > Int_array_Var = "pointer to Int_Array_Var_System1" You can do something like: type Int_Array_Ref is access all INT_ARRAY; Int_Array_Var : Int_Array_Ref; ... if .,. then Int_Array_Var := Int_Array_Var_System1'Access; -- Make Int_Array_Var point to Int_Array_Var_System1. ... You need to make the variables "aliased" -- otherwise, 'Access is illegal. You might need to add ".all" in a few places, but in most contexts (including A'Range, and A(I)), the ".all" is implicit. But it might be cleaner to pass the arrays around as parameters. - Bob