Elements of a TDouble2DArray

Feel free to discuss any questions regarding Epina ImageLab :-)
Post Reply
zgajarsk
Posts: 3
Joined: Thu Oct 08, 2020 10:32 am

Elements of a TDouble2DArray

Post by zgajarsk »

Hi,

I would like to ask how could one access the elements of a TDouble2DArray.

I was trying to achieve this using square brackets and comma as follows:

Element := DataMatrix[1,1];

however, I would get the following error:

Compiler: [Error] (126:35): Closing square bracket (']') expected

Kind regards,
Zuzana
User avatar
hlohning
Posts: 8
Joined: Fri Sep 04, 2020 7:45 pm

Re: Elements of a TDouble2DArray

Post by hlohning »

Hi Zuzana,
the TDouble2DArray is an open array declared as "array of array of double". Thus accessing a variable of type TDouble2DArray has to take this into account by using square brackets for each index.

Example, assigning a numeric value to a particular cell of the array:

Code: Select all

var
   my2da : TDouble2DArray;
...
my2da[i][j]  := 2.3443;  //  (instead of my2da[i,j] := 2.3443;) 
...
Hope this helps,
Hans
---
Hans Lohninger
Epina GmbH
Retz, Austria
zgajarsk
Posts: 3
Joined: Thu Oct 08, 2020 10:32 am

Re: Elements of a TDouble2DArray

Post by zgajarsk »

Dear Hans,

thank you very much for your reply, it works perfectly!

Kind regards,
Zuzana
Post Reply