VBS教程:函數(shù)-UBound 函數(shù)
更新時間:2006年11月16日 00:00:00 作者:
UBound 函數(shù)
返回指定數(shù)組維數(shù)的最大可用下標。
UBound(arrayname[, dimension])
參數(shù)
arrayname
必選項。數(shù)組變量名,遵循標準變量命名約定。
Dimension
可選項。指定返回哪一維上界的整數(shù)。1 表示第一維,2 表示第二維,以此類推。如果省略 dimension 參數(shù),則默認值為 1。
說明
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 |
您可能感興趣的文章:
相關(guān)文章
用vbs檢測Internet Explorer 中是否啟用了 ActiveX
用vbs檢測Internet Explorer 中是否啟用了 ActiveX...2007-03-03

