Conversion.Oct Method (Byte)

Returns a string representing the octal value of a number.

Namespace: Microsoft.VisualBasic
Assembly: Microsoft.VisualBasic (in microsoft.visualbasic.dll)

public static string Oct (
	byte Number
)
public static String Oct (
	byte Number
)
public static function Oct (
	Number : byte
) : String
Not applicable.

Parameters

Number

Required. Any valid numeric expression or String expression.

Return Value

Returns a string representing the octal value of a number.

For more detailed information, see the Visual Basic topic Oct Function.

If Number is not already a whole number, it is rounded to the nearest whole number before being evaluated.

If Number is

Oct returns

Empty

Zero (0)

Any other number

Up to 22 octal characters

You can represent octal numbers directly by preceding numbers in the proper range with &O. For example, &O10 is the octal notation for decimal 8.

This example uses the Oct function to return the octal value of a number.

Dim TestOct As String
' Returns "4".
TestOct = Oct(4)
' Returns "10".
TestOct = Oct(8)
' Returns "713".
TestOct = Oct(459)

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Show: