Icon View Incident Report

Serious Serious
Reported By: Michael Dreher
Reported On: 10/27/2017
For: Version 2.06 Build 10
# 4596 Compiler Cannot Compile Multi-Dimensional Array Initialization Using SetLength

I have defined the following types and variables and am using as follows.

While this all compiles, it will, of course, result in a "runtime error: 0 reference access access" because the dymanic array yet is not initialized. But how to initialize a multidimensional array?

What I've unsuccessfully tried:

i) SetLength(i2d, 2);
This compiles but of course the runtime error remains(only one dimension is initialized).

ii) SetLength(i2d[0], 3);
Try to initialize the 2'nd dimension of the 1'st element, Compiler error: Expected parameter name or variable name but instead found i2d[0]

iii) SetLength(i2d, 2, 3);
Try to initialize an 2x3 array -> Compile error: "There is no function or procedure declaration that matches the SetLength(i2d, 2, 3) reference"

iv) i2d := [[1,2,3],[4,5,6]];
Try to initialize with const int values, Compiler error: "Expected T2DIntArray but instead found"

 TIntArray = array of integer;
 T2DIntArray = array of TIntArray;

 i : TIntArray;
 i2d : T2DIntArray;
 intValue : integer;

procedure foo;
 // ....
 i2d[0][0] := 42;
 intValue := i2d[0][0];

Resolution Resolution
Fixed Problem on 10/28/2017 in version 2.06 build 11

Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial