comp.lang.ada
 help / color / mirror / Atom feed
* problem in changing Discriminants from access type
@ 1998-05-12  0:00 Gil Kaspi
  1998-05-11  0:00 ` Matthew Heaney
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gil Kaspi @ 1998-05-12  0:00 UTC (permalink / raw)



this program was build to simulate dynamic array .
(it should be a package that has
    type arr is private;   and    arr defenition is access to arr_node)
----------------------------------------------------------------------------
-----------------

procedure d_array is

 type Arr_Node;

type arr is access arr_node;

type Test is array (Integer range <>) of Integer;

subtype Int_Limits is Integer range -1000..1000;

type Int_Arr is array (Int_Limits range <>) of Integer;

type Arr_Node (Start : Int_Limits :=1; Ends : Int_Limits := 0) is
record
   Store : Int_Arr (Start..Ends);
end record;

-- declare --
D_Arr : Arr;

begin

-- create --
D_Arr := new Arr_Node'(Start => 1, Ends => 0, Store => (others => 0));

-- change --
D_Arr.all :=(Ends => Index, Start => Index , Store => (others =>1));

end;
----------------------------------------------------------------------------
------------------------

!!! first, writing this code without the access will work OK.
running this code will raise CONSTRAINT_ERROR.
the problem I think is hiding in the last line

10x 4 any1 that will help
gil.







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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-12  0:00 problem in changing Discriminants from access type Gil Kaspi
1998-05-11  0:00 ` Matthew Heaney
1998-05-11  0:00 ` Lowe Anthony A
1998-05-11  0:00   ` Matthew Heaney
1998-05-12  0:00 ` Anonymous

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