Method

Oct


Description

Returns as a string, the octal version of the number passed.

Usage

result = Oct(value)

Part

Type

Description

result

String

The value passed converted to octal.

value

Integer

The number to be converted to octal.

Notes

If the value is not a whole number, the decimal value will be truncated.

VB Compatibility Note: VB rounds the value to the nearest whole number so the Oct function will probably be changed in a future release to do this as well.

You can specify binary, hex, or octal numbers by preceding the number with the & symbol and the letter that indicates the number base. The letter b indicates binary, h indicates hex, and o indicates octal.

Sample code

Here are examples of various numbers converted to octal:

Var octVersion As String
octVersion = Oct(5) ' returns "5"
octVersion = Oct(75) ' returns "113"
octVersion = Oct(256) ' returns "400"

Compatibility

All project types on all supported operating systems.

See also

&b, &h, &o literals, Bin, Hex, Integer.FromOctal, Integer.ToOctal functions.