Hi,
how do I get the dimensions of a dynamic array? For instance, like the following:
type
PMatr2Dob10 = ^Tmatr2Dob10; Tmatr2Dob10 (Size1, Size2: Integer) = array [ 1 .. Size1, 0 .. Size2 ] of double;
var
kets: Pmatr2Dob10
Thanks very much
Silvio a Beccara - Cornell University, USA
Silvio a Beccara wrote:
how do I get the dimensions of a dynamic array? For instance, like the following:
type
PMatr2Dob10 = ^Tmatr2Dob10; Tmatr2Dob10 (Size1, Size2: Integer) = array [ 1 .. Size1, 0 .. Size2 ] of double;
var
kets: Pmatr2Dob10
Try e.g.
Dimension1 := kets^.Size1;
This will give you the value you have assigned to Size1 when allocating the array.
Best,
Markus
Silvio a Beccara a écrit:
how do I get the dimensions of a dynamic array? For instance, like the following:
type
PMatr2Dob10 = ^Tmatr2Dob10; Tmatr2Dob10 (Size1, Size2: Integer) = array [ 1 .. Size1, 0 .. Size2 ] of double;
var
kets: Pmatr2Dob10
kets^.Size1 kets^.Size2
Maurice
Maurice Lombardi wrote:
Silvio a Beccara a écrit:
how do I get the dimensions of a dynamic array? For instance, like the following:
type
PMatr2Dob10 = ^Tmatr2Dob10; Tmatr2Dob10 (Size1, Size2: Integer) = array [ 1 .. Size1, 0 .. Size2 ] of double;
var
kets: Pmatr2Dob10
kets^.Size1 kets^.Size2
For schemata (like here) that's recommended. For other arrays, you can also use `Low' and `High' (here: `Low (kets^)', `High (kets^[1])' etc.).
Frank