返回指定數(shù)組維數(shù)的最大可用下標(biāo)。
UBound(arrayname[, dimension])
UBound 函數(shù)與 LBound 函數(shù)一起使用,用于確定數(shù)組的大小。使用 LBound 函數(shù)可以確定數(shù)組某一維的下界。
所有維的下界均為 0。對于有這樣維數(shù)的數(shù)組,UBound 函數(shù)返回以下結(jié)果:
Dim A(100,3,4)
| 語句 | 返回值 |
|---|---|
| UBound(A, 1) | 100 |
| UBound(A, 2) | 3 |
| UBound(A, 3) | 4 |