When I have a two-dimensional array 'x' I used to find out the extent of
the second dimension by requesting the size of the first subarray, that is
'NUMBER(x[0])'. But if the array has size 0 in the first dimension this
fails, since there is no subarray 'x[0]'. But there is an extent in the
second dimension! How to find it out without hacking?
The following program may demonstrate the problem. The program aborts with
an error (correctly) because it encounters that 'a[0]' does not exist:
MODULE Main;
(* What happens with ARRAYs that have zero extent in one dimension? *)
VAR a := NEW(REF ARRAY OF ARRAY OF INTEGER, 0, 10);
BEGIN
EVAL NUMBER(a[0]);
END Main.