From: Jean-Baptiste CAMPESATO <camje_lemon@nospam.a2lf.org>
Subject: Re: délcarer un array sans indices.
Date: Sun, 20 Mar 2005 15:45:23 +0100
Date: 2005-03-20T15:44:10+01:00 [thread overview]
Message-ID: <pan.2005.03.20.14.45.23.545497@nospam.a2lf.org> (raw)
In-Reply-To: slrnd3r2ik.su2.adi@ppc201.mipool.uni-jena.de
Le Sun, 20 Mar 2005 14:36:04 +0000, Adrian Knoth a ᅵcritᅵ:
> 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);
Scuse for post in French, my problem is not exactly that.
My problem is :
I created a type : Matrice.
I want create a variable of Matrice (gauss:Matrice;) when we execute my
programm
But i don't know the range of my matrix. The user will give me
the number of range after.
How can i create a Array without range and after give to the programme the
range ?
thanks a lot
next prev parent reply other threads:[~2005-03-20 14:45 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
2005-03-20 14:45 ` Jean-Baptiste CAMPESATO [this message]
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