K Krish Apr 29, 2004 #1 How do you find out the number of rows in the array {Array} I have [0,0] [0,1] [1,0] [1,1] ..... thanks
How do you find out the number of rows in the array {Array} I have [0,0] [0,1] [1,0] [1,1] ..... thanks
B Bjorn Abelli Apr 29, 2004 #2 ... How do you find out the number of rows in the array {Array} I have [0,0] [0,1] Click to expand... The concepts of "rows" and "columns" suggests only two-dimensional arrays, but there can actually be many more. To get the number of dimensions you can use int dimensions = myArray.Rank; To check how "big" each dimension is you have e.g. the method GetUpperBound which takes the "dimension" as argument. But let's say that you only have just two dimensions, and want to know how many "rows" there are, you check the "first dimension": int rows = myArray.GetUpperBound(0) + 1; For other things you can do with an array: http://msdn.microsoft.com/library/d...-us/cpref/html/frlrfSystemArrayClassTopic.asp If the link above wrapped, try http://tinyurl.com/ywhb8 // Bjorn A
... How do you find out the number of rows in the array {Array} I have [0,0] [0,1] Click to expand... The concepts of "rows" and "columns" suggests only two-dimensional arrays, but there can actually be many more. To get the number of dimensions you can use int dimensions = myArray.Rank; To check how "big" each dimension is you have e.g. the method GetUpperBound which takes the "dimension" as argument. But let's say that you only have just two dimensions, and want to know how many "rows" there are, you check the "first dimension": int rows = myArray.GetUpperBound(0) + 1; For other things you can do with an array: http://msdn.microsoft.com/library/d...-us/cpref/html/frlrfSystemArrayClassTopic.asp If the link above wrapped, try http://tinyurl.com/ywhb8 // Bjorn A