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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Passing a 2d array into a package and returning the same processed 2d back to main Date: Fri, 30 Sep 2016 17:01:23 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <44638b2d-c7fb-4113-9262-d57dd1cd5629@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 1 Oct 2016 00:01:14 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="6df4b173985f7c5c043cea362c370ff7"; logging-data="30601"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MBTB7HE56JlTEwk9idwnVYRDCRLAYgzA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 In-Reply-To: <44638b2d-c7fb-4113-9262-d57dd1cd5629@googlegroups.com> Cancel-Lock: sha1:2HvoHN9rHnl8dQ54bLxBp+HmP6E= Xref: news.eternal-september.org comp.lang.ada:31951 Date: 2016-09-30T17:01:23-07:00 List-Id: On 09/30/2016 03:27 PM, diane74@gmail.com wrote: > Hello again, new Ada programmer with a hopefully easy question. > I am trying to take a 2d array pass it to a package have the package change the data in the 2d array and send the same 2d array (with modified data) back to the main program. I am currently away from my computer or I would show you my broken code, though I doubt it would be useful. It sounds as if you might be interested in "Formal Parameter Modes", defined in ARM 6.2: http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-6-2.html The mode defines the direction of data flow between the subprogram and the caller: "in" means data flows from the caller into the subprogram; "out" means data flows from the subprogram back to the caller; what "in out" means is left as an exercise for the reader. -- Jeff Carter "Run away! Run away!" Monty Python and the Holy Grail 58