I have such an array:
12 | 18 | 22 | 26 | 28 | 32 | 34 | 36 | 50
16 23 33 37
As you can see, it consists of two rows, but some have one element and some have two.
I'm trying to write a function that takes an array of arrays as a parameter.
I declared myself a type:
type array_of_array_of_Byte = array of array of Byte;
function my_function(value_list: array_of_array_of_Byte)
And I call the function like this:
my_function([[12,16], [18], [22,23], [26], [28], [32,33], [34], [36,37], [50]]);
But I get error:
Ordinal type required
What am I doing wrong? I'm using Delphi XE4.
Unfortunately, the ability to initialize a dynamic array from a constant array expression wasn't supported yet in XE4, it was added in XE7:
Dynamic Arrays in Delphi XE7
So, in your case, you have no choice but to simply build up your dynamic arrays manually the old fashioned way - using
SetLength()and per-element assignments, eg: