How Do You Determine A Multidimensional Array Ubound In Visual Basic?
Multidimensional arrays are variables used to hold lists of characters or numbers. Some applications call for you to loop through the array values. Before you can loop through an array, you first need to know the upper bound (ubound). The upper bound is the maximum amount of characters or numbers an array can hold. Visual Basic has an internal function that allows you to quickly calculate the upper bound number for single and multidimensional arrays. Load your Visual Basic project into Visual Studio. Right-click the form you want to edit and select “View Code.” This opens your code-behind file. Create a multidimensional array and integer variables to hold the upper bound part of the array. The code to create a multidimensional array in Visual Basic is the following: Dim arVar(1,3) as Integer Dim intUboundFirstDimension as Integer Dim intUboundSecondDimension as Integer Calculate the upper bound of each dimension in the array. The following code identifies how many values each dimension