comp.lang.ada
 help / color / mirror / Atom feed
* assigning record address using access, w/unconstrained array
@ 1998-09-19  0:00 Technobabble
  1998-09-19  0:00 ` Tucker Taft
  1998-09-20  0:00 ` dewarr
  0 siblings, 2 replies; 4+ messages in thread
From: Technobabble @ 1998-09-19  0:00 UTC (permalink / raw)


Greetings,

The following is the code I've got a gnat error with.  This code is
relation to the previous array RANGE questions I've had.

--File: test_pkg.ads
package test_pkg is

--Types:
 type xyz_array is array (integer range <>) of integer;   -- this is it

 type xyz_array_pointer is access all xyz_array;

 type xyz_array_pointer_array is array (1..100) of xyz_array_pointer;


 type Object is
     record
        XYZ : xyz_array_pointer_array;    
        abc : integer;
     end record;

-- declarations:
 xyz5_array : aliased xyz_array := (1..5 => 0);

 procedure my_range (This : in Object); 

end test_pkg;

---------------------
--File: test_pkg.adb
package body test_pkg is

  procedure my_range (This : in Object) is
  begin 
                This.XYZ(1) := xyz5_array'ACCESS;  
--       rangexyz :=  This.XYZ(1)'RANGE;

  end my_range;
end test_pkg;

--------------------

GNAT produces the following error after compiling test_pkg.adb:

test_pkg.adb:18:17: assignment to "in" mode parameter not allowed


******

After I comment out the suspect line:
                This.XYZ(1) := xyz5_array'ACCESS;  -- address of xyz_array
type is assigned

and put a null in the procedure 'my_range' it compiles fine. As for the
RANGE attribute, well I just have not been able to get to it yet since the
line above it bombs.


******


HELP !!

thanks,
Richmond
therionics@computer.org




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-09-20  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-19  0:00 assigning record address using access, w/unconstrained array Technobabble
1998-09-19  0:00 ` Tucker Taft
1998-09-19  0:00   ` Technobabble
1998-09-20  0:00 ` dewarr

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