

-----------------------------------

smool

Mon Mar 26, 2012 5:32 pm


finding the upper of a multidimensional array

-----------------------------------

I know that this works:



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?:



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".


-----------------------------------

Tony

Mon Mar 26, 2012 5:36 pm


RE:finding the upper of a multidimensional array

-----------------------------------

upper(m,2) -- see the docs, upper(m(1,1)) resolves to upper(int), which is why it's not acceptable.


-----------------------------------

smool

Mon Mar 26, 2012 8:46 pm


RE:finding the upper of a multidimensional array

-----------------------------------

ah thanks

