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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,72c538d48d9fcd8a X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: assigning record address using access, w/unconstrained array Date: 1998/09/19 Message-ID: #1/1 X-Deja-AN: 392812096 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-09-19T00:00:00+00:00 List-Id: Technobabble (WishList@2600.com) wrote: : 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 ***>>> ^^ "in out" should solve your problem. : 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 As well it should. Just change the parameter mode to "in out" if you want the procedure to update its parameter. : ... : thanks, : Richmond : therionics@computer.org -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company