comp.lang.ada
 help / color / mirror / Atom feed
From: Adrian Knoth <adi@thur.de>
Subject: Re: délcarer un array sans indices.
Date: 20 Mar 2005 14:36:04 GMT
Date: 2005-03-20T14:36:04+00:00	[thread overview]
Message-ID: <slrnd3r2ik.su2.adi@ppc201.mipool.uni-jena.de> (raw)
In-Reply-To: pan.2005.03.20.14.26.53.218306@nospam.a2lf.org

Jean-Baptiste CAMPESATO <camje_lemon@nospam.a2lf.org> wrote:

> Par exemple, j'ai le type :
> type Matrice is array ( Integer range <>, Integer range <>) of Float; 
> Je souhaite d�clarer une variable gauss, sans indices, de type Matrice et
> plus tard dans le programme, suite a une intervention de l'utilisteur
> donner les indices ad�quates.

Sorry for not answering en fran�aise, I hope you'll still be able
to understand the response:

procedure jean is
   type Matrice is array ( Integer range <>, Integer range <>) of Float;

   procedure something (a, b, c, d : in Positive ) is
      gauss : Matrice (a .. b, c .. d);
   begin
      null;
   end something;

   a, b, c, d : Positive;

begin
   a := 1;
   b := 300;
   c := 1;
   d := 200;
   something (a, b, c, d);
end jean;

Just ask your user about the real values of a,b,c,d. For a large
matrix it could be better to allocate heap memory:

   type Matrice_ptr is access Matrice;
   gauss : Matrice_ptr := new Matrice (a .. b, c .. d);


-- 
mail: adi@thur.de  	http://adi.thur.de	PGP: v2-key via keyserver

Das Fleisch war willig, doch das Gras war na�



  parent reply	other threads:[~2005-03-20 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-20 14:26 délcarer un array sans indices Jean-Baptiste CAMPESATO
2005-03-20 14:31 ` Jean-Baptiste CAMPESATO
2005-03-20 14:33 ` Jean-Baptiste CAMPESATO
2005-03-20 14:36 ` Adrian Knoth [this message]
2005-03-20 14:45   ` Jean-Baptiste CAMPESATO
2005-03-20 15:09     ` Adrian Knoth
2005-03-20 15:12       ` Jean-Baptiste CAMPESATO
2005-03-20 15:49       ` Marius Amado Alves
replies disabled

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