From: km38#@andrew.cmu.edu.UUCP
To: outnews#ext.nn.comp.lang.ada@andrew.cmu.edu
Subject: Formal out parameters
Date: Tue, 24-Feb-87 22:20:31 EST [thread overview]
Date: Tue Feb 24 22:20:31 1987
Message-ID: <MS.V3.18.km38.80021108.allentown.ibm032.3469.2@andrew.cmu.edu> (raw)
Another problem...
with the following declaration,
type RESOURCE_REC;
type RESOURCE is
access RESOURCE_REC;
type RESOURCE_REC is
record
RESOURCE_NAME : FOO.NAME;
...
end;
procedure CREATE (NEW_RESOURCE : out RESOURCE;
RESOURCE_NAME : in FOO.NAME) is
begin
NEW_RESOURCE := new RESOURCE_REC;
NEW_RESOURCE.RESOURCE_NAME := RESOURCE_NAME;
end CREATE;
I get the following error (for the second assignment):
106 NEW_RESOURCE.RESOURCE_NAME := RESOURCE_NAME;
................1
%ADAC-E-READ, (1) Reading from subprogram 'out' formal NEW_RESOURCE at line
92
is not allowed
Does this mean that my parameter declaration only allows me to assign a value
to the pointer, not to the record pointed to? It seems to me that this error
is not justified, as I am not reading anything from the NEW_RESOURCE
parameter, but merely initializing (writing to) part of it.
Also, with another compiler validated with ACVC 1.5, there is no error.
Thanks,
--Magnus
Arpa: magnus@andrew.cmu.edu
UUCP: seismo!andrew.cmu.edu!magnus
reply other threads:[~1987-02-25 3:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox