Computer Science Canada

finding the upper of a multidimensional array

Author:  smool [ Mon Mar 26, 2012 5:32 pm ]
Post subject:  finding the upper of a multidimensional array

I know that this works:

Turing:


var m : array 1.. 4 of array 1..7 of int
put upper (m (1))



But how do I find the upper if the array has been declared like this?:

Turing:


var m : array 1.. 4, 1..7 of int
put upper ( ? ? )



Because "upper (m (1))" says that 'm' has too few subscripts, and "upper (m (1, 1))" says that upper cannot accept that as a parameter. I cant just switch the way I declared the variable, as it's in a function, and you cannot take in "m : array 1..* of array 1..* of real" as a parameter, it has to be "m : array 1..*, 1..* of real".

Author:  Tony [ Mon Mar 26, 2012 5:36 pm ]
Post subject:  RE:finding the upper of a multidimensional array

upper(m,2) -- see the docs, upper

P.S. upper(m(1,1)) resolves to upper(int), which is why it's not acceptable.

Author:  smool [ Mon Mar 26, 2012 8:46 pm ]
Post subject:  RE:finding the upper of a multidimensional array

ah thanks


: