comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: "out" or "access"
Date: 1998/10/21
Date: 1998-10-21T00:00:00+00:00	[thread overview]
Message-ID: <F16K5L.F2B.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 908956499.754394@dedale.pandemonium.fr

=:-) Vincent (vb@bruker.fr) wrote:
: What's the best way ?

An "out" parameter is always preferable to an "access" parameter, in my view.  

Use an "access" parameter only if you need an access value when
inside the called subprogram for some reason.  This usually only
happens when interfacing to some other language, or some preexisting
subsystem of some sort.

: 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;

: Thanks.

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




  parent reply	other threads:[~1998-10-21  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-21  0:00 "out" or "access" =:-) Vincent
1998-10-21  0:00 ` Jeff Carter
1998-10-21  0:00   ` Pat Rogers
1998-10-21  0:00     ` Martin C. Carlisle
1998-10-22  0:00       ` Pat Rogers
1998-10-22  0:00     ` Robert A Duff
1998-10-21  0:00 ` dennison
1998-10-21  0:00 ` Tucker Taft [this message]
1998-10-22  0:00   ` Pascal Obry
1998-10-29  0:00     ` Robert A Duff
1998-10-29  0:00       ` Matthew Heaney
1998-10-29  0:00         ` Robert A Duff
1998-10-30  0:00           ` dennison
1998-10-30  0:00             ` Matthew Heaney
1998-10-30  0:00               ` Robert A Duff
1998-10-31  0:00                 ` dewar
1998-10-31  0:00                   ` Matthew Heaney
1998-10-31  0:00                 ` Matthew Heaney
1998-11-01  0:00                   ` Robert A Duff
1998-11-01  0:00                     ` Matthew Heaney
1998-11-01  0:00                       ` Robert A Duff
1998-11-02  0:00                         ` Matthew Heaney
1998-11-03  0:00                           ` Simon Wright
1998-11-16  0:00                             ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox