Export (0) Print
Expand All

How to: Get a Value from an Array

You can get one of an array's values by using the array name and the appropriate indexes to specify the individual element.

To get a value from an array element

  1. Inside an expression, specify the array name followed by parentheses.

  2. Inside the parentheses, include an expression for each index corresponding to the element you want to get. You need one index for each array dimension. The following example shows some statements that get values from arrays.

    Dim sortedValues(), rawValues(), estimates(,,) As Double
    lowestValue = sortedValues(0)
    wTotal += (rawValues(v) ^ 2)
    firstGuess = estimates(i, j, k)
    

For each array dimension, the GetUpperBound method returns the highest value the index can have. The lowest index value is always 0.

Community Additions

ADD
Show:
© 2014 Microsoft