comp.lang.ada
 help / color / mirror / Atom feed
* Formal out parameters
@ 1987-02-25  3:20 km38#
  0 siblings, 0 replies; only message in thread
From: km38# @ 1987-02-25  3:20 UTC (permalink / raw)
  To: outnews#ext.nn.comp.lang.ada


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1987-02-25  3:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1987-02-25  3:20 Formal out parameters km38#

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