Visual Basic Scripting Edition | 語言參考 |
返回表示數(shù)字八進制值的字符串。
Oct(number)
number 參數(shù)是任意有效的表達式。
如果 number 參數(shù)不是整數(shù),則在進行運算前,將其四舍五入到最接近的整數(shù)。
如果 number 是 | Oct 返回 |
---|---|
Null | Null。 |
Empty | 零 (0)。 |
任意其他數(shù)字 | 最大可到 11 位的八進制字符。 |
用戶也可以通過直接在數(shù)前加上 &O 表示八進制數(shù)。例如,&O10 為十進制數(shù) 8 的八進制表示法。
下面的示例利用 Oct 函數(shù)返回數(shù)值的八進制數(shù):
Dim MyOct MyOct = Oct(4) '
返回4
。MyOct = Oct(8) '
返回10
。MyOct = Oct(459) '
返回713
。