Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Modula 3 > ARRAYs of zero ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 78 of 148
Post > Topic >>

ARRAYs of zero size

by Henning Thielemann <iakd0@[EMAIL PROTECTED] > Jan 13, 2004 at 02:23 PM

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.




 1 Posts in Topic:
ARRAYs of zero size
Henning Thielemann <ia  2004-01-13 14:23:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 18:47:39 CDT 2008.