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.1 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9a7e0c43216f4def X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: "out" or "access" Date: 1998/10/21 Message-ID: <362DF0D3.BC101364@spam.innocon.com>#1/1 X-Deja-AN: 403564763 Content-Transfer-Encoding: 7bit References: <908956499.754394@dedale.pandemonium.fr> To: "=:-) Vincent" Content-Type: text/plain; charset=us-ascii Organization: Innovative Concepts, Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-10-21T00:00:00+00:00 List-Id: =:-) Vincent wrote: > > What's the best way ? > > package B is > ... > The_Procedure ( The_Parameter: out Integer ); > -- or The_Procedure ( The_Parameter: access Integer ); > ... > end B; > ... > package body A is > ... > g_Toto: Integer; -- or aliased Integer > ... > procedure The_Other_Procedure is > begin > ... > B.The_Procedure ( g_Toto ); > -- or B.The_Procedure( g_Toto'Access ); > ... > end; > ... > end A; There's no comparison. An access parameter is closer to an "in out" parameter than an "out" parameter. If an "out" parameter will do, do not use an access parameter if you can avoid it. If an "in out" parameter will do, still don't use an access parameter if you can avoid it. Access parameters exist primarily to interfaces with subprograms from other languages. -- Jeff Carter PGP:1024/440FBE21 E-mail: carter commercial-at innocon period com "Monsieur Arthur King, who has the brain of a duck, you know." Monty Python & the Holy Grail