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 Laboratoire de Spectrometrie Physique, Universite Joseph Fourier de Grenoble, BP87 38402 Saint Martin d'Heres Cedex FRANCE Tel: 33 (0)4 76 51 47 51 Fax: 33 (0)4 76 63 54 95 mailto:Maurice.Lombardi@ujf-grenoble.fr
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 -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
participants (4)
-
Frank Heckenbach -
Markus Gerwinski -
Maurice Lombardi -
Silvio a Beccara