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=2.1 required=5.0 tests=BAYES_00,INVALID_MSGID,
MSGID_RANDY,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no
version=3.4.4
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 103376,9a7e0c43216f4def
X-Google-Attributes: gid103376,public
From: "Pascal Obry"
Subject: Re: "out" or "access"
Date: 1998/10/22
Message-ID: <70mo3h$gll$1@cf01.edf.fr>#1/1
X-Deja-AN: 403848850
References: <908956499.754394@dedale.pandemonium.fr>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: EDF
Newsgroups: comp.lang.ada
Date: 1998-10-22T00:00:00+00:00
List-Id:
Tucker Taft a �crit dans le message ...
>=:-) 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.
>
Ok but be carefull. With an access type you can't pass a null pointer. This
is a big problem.
In fact if you look at the Win32 C API or UNIX C library you'll find that it
is often possible
to pass a null pointer to some parameters to say : "ignore this one, I don't
care for the result" !
So, in many many cases it is better to use an access type (not an access
formal parameter)
when interfacing with some other language.
Pascal.
PS : The Win32Ada binding is full of access parameters that are just wrong !