Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 finding the upper of a multidimensional array
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
smool




PostPosted: 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".
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
smool




PostPosted: Mon Mar 26, 2012 8:46 pm   Post subject: RE:finding the upper of a multidimensional array

ah thanks
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: