Dynamic 2D array?



Hi

Is it possible to declare a 2D array, which has different lengths in the 2nd
dimension?

This is my array

MyArray : array[1.9,1..9] of byte

This gives me a 9x9 array. What i want is something like this:

MyArray dimension1 should have 5 values in the second dimension
MyArray dimension2 should have 7 values in the second dimension
MyArray dimension3 should have 4 values in the second dimension
etc

Which means that if i want to acces MyArray, dimension1, there is only 5
values in the 2nd dimension.
MyArray[1,1..5]
MyArray[2,1..7]
MyArray[3,1..4]

So accesing MyArray[1,6] would give an rangecheck error, but MyArray[2,7]
will not.
Is that possible?



.



Relevant Pages

  • Re: Playing with multidimensional array!?
    ... In traditional compiler languages, rows and columns are differentiated by ... the fact that a two dimensional array occupies contiguous storage locations. ... fact that redim can affect only the last dimension. ... consider these the first dimension and the second dimension rather than row ...
    (microsoft.public.scripting.vbscript)
  • Re: Array
    ... > ich habe in einem Array Informationen ... > In der Zweiten Dimension sind 5 Informationen pro Zeile. ... Hallo Markus, ... REDIM myArray geht dann und der Zugriff ist z.B. ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Extracting nth element of X dimension
    ... I have a 5D array. ... I have counters which I use for the first, third, ... the length of the second dimension is changing constantly as ...
    (microsoft.public.excel.programming)
  • Re: UBound confusion
    ... I would expect that myarray is of length 6 and that the array ... Since array subscripts start at 0, the length of a dimension is greater ... by one than the highest available subscript for that dimension. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Dynamic 2D array?
    ... Is it possible to declare a 2D array, which has different lengths in the ... 2nd dimension? ... MyArray: ...
    (comp.lang.pascal.delphi.misc)