comp.lang.ada
 help / color / mirror / Atom feed
From: Aurele <aurele.vitali@gmail.com>
Subject: Re: Using Access Types for a simple solution
Date: Tue, 26 Jul 2016 11:16:23 -0700 (PDT)
Date: 2016-07-26T11:16:23-07:00	[thread overview]
Message-ID: <cbba5eb0-1885-4560-bcf2-9647d52bea1f@googlegroups.com> (raw)
In-Reply-To: <579615c5$0$20671$e4fe514c@news.kpn.nl>

Maybe try something like this (just a suggestion):

procedure Matric_Demo is

  type Matrix is record
    x : integer := 0;
    y : integer := 0;
    z : integer := 0;
    t : integer := 0;
        :
  end record;
  type Matrix_Ptr is access all Matrix;
  
  type Grid is array ( 1..Integer'last, 1..integer'last ) of Matrix_Ptr;
  type Grid_Ptr is access all Grid;
  
  My_Matrix_Ptr : Matrix_Ptr := new Matrix;

  My_Grid_Ptr_1 : Grid_Ptr := new Grid; 
  My_Grid_Ptr_2 : Grid_Ptr := new Grid; 
     :
  My_Array      : array ( 1 .. integer'last ) of Grid_Ptr; 
  
begin

  My_Matrix_Ptr.x := 1;
  My_Matrix_Ptr.y := 2;
  My_Matrix_Ptr.y := 3;
  My_Matrix_Ptr.y := 4;
     :
  My_Grid_Ptr_1( 1, 1 ) := My_Matrix_Ptr;
     :
  My_Array( 1 ) := My_Grid_Ptr_1;
     :
end Matric_Demo;


      parent reply	other threads:[~2016-07-26 18:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 13:35 Using Access Types for a simple solution ldries46
2016-07-25 14:28 ` Dmitry A. Kazakov
2016-07-25 15:27 ` ldries46
2016-07-25 21:39   ` rieachus
2016-07-26 18:16 ` Aurele [this message]
replies disabled

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