Table of contents

Oct 函数Oct Function

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

返回一个variant 类型的值字符串) 表示数字的八进制值。语法10 月数字)要求的_数字_参数是任何有效的数值表达式字符串表达式备注如果_number_不是整数,它在计算前会先舍入为最接近的整数。Returns a Variant ( String ) representing the octal value of a number. SyntaxOct ( number ) The required numberargument is any validnumeric expression orstring expression. Remarks If number is not already a whole number, it is rounded to the nearest whole number before being evaluated.

如果_号码_If number is10 月返回Oct returns
为空Empty零 (0)Zero (0)
任何其他数字Any other number多达 11 个八进制字符Up to 11 octal characters

您可以通过在适当范围的数字之前来直接表示八进制数字&;O。例如。例如,&;O10是十进制数字 8 的八进制表示法。You can represent octal numbers directly by preceding numbers in the proper range with &;O. For example, . For example, &;O10 is the octal notation for decimal 8.


本示例使用Oct函数可返回一个数字的八进制值。This example uses the Oct function to return the octal value of a number.

Dim MyOct
MyOct = Oct(4)     ' Returns 4.
MyOct = Oct(8)    ' Returns 10.
MyOct = Oct(459)    ' Returns 713.

© 2018 Microsoft