Hi,

> Well, in an INFORMATION flavor dimensioned arrays are supposed to be
> dynamically resizable 

The problem described by this thread is an oddity forced on us by the 
syntax/semantics of matrices passed as arguments.

If you define a subroutine as, for example,
   SUBROUTINE MYSUB(MAT X)
this tells the compiler that you are expecting to receive a whole matrix as an 
argument but does not have any way to say whether
this has one or two dimensions.

The designers of Prime Information chose to say that the subroutine must 
contain a DIM statement
   DIM X(2,4)
where the values in the brackets are simply counted to determine the 
dimensionality of the matrix and have no relevance to the
actual size. The Prime documentation says "A matrix passed as an argument must 
be dimensioned in an external subroutine before it
can be referenced. Any change to the [column and row] subscripts 
(redimensioning) is ignored and the dimensioning defined in the
calling program prevails".

Because the dimension values are ignored, they are often written as, for 
example,
   DIM X(1,1)
to emphasise that the values are meaningless.

Of course, it would be nice if the compiler treated the first DIM statement in 
this way but then redimensioned for any subsequent
DIM statement in the subroutine. Sadly, it doesn't.


Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200



_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to