Conversion.Oct Conversion.Oct Conversion.Oct Conversion.Oct Method

Definition

Returns a string representing the octal value of a number.

Overloads

Oct(UInt64) Oct(UInt64) Oct(UInt64) Oct(UInt64)

Returns a string representing the octal value of a number.

Oct(UInt32) Oct(UInt32) Oct(UInt32) Oct(UInt32)

Returns a string representing the octal value of a number.

Oct(UInt16) Oct(UInt16) Oct(UInt16) Oct(UInt16)

Returns a string representing the octal value of a number.

Oct(SByte) Oct(SByte) Oct(SByte) Oct(SByte)

Returns a string representing the octal value of a number.

Oct(Byte) Oct(Byte) Oct(Byte) Oct(Byte)

Returns a string representing the octal value of a number.

Oct(Int64) Oct(Int64) Oct(Int64) Oct(Int64)

Returns a string representing the octal value of a number.

Oct(Int32) Oct(Int32) Oct(Int32) Oct(Int32)

Returns a string representing the octal value of a number.

Oct(Int16) Oct(Int16) Oct(Int16) Oct(Int16)

Returns a string representing the octal value of a number.

Oct(Object) Oct(Object) Oct(Object) Oct(Object)

Returns a string representing the octal value of a number.

Oct(UInt64) Oct(UInt64) Oct(UInt64) Oct(UInt64)

Important

This API is not CLS-compliant.

CLS-compliant alternative
Microsoft.VisualBasic.Conversion.Oct(Int64)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(System::UInt64 Number);
[System.CLSCompliant(false)]
public static string Oct (ulong Number);
static member Oct : uint64 -> string
Public Function Oct (Number As ULong) As String

Parameters

Number
UInt64 UInt64 UInt64 UInt64

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(UInt32) Oct(UInt32) Oct(UInt32) Oct(UInt32)

Important

This API is not CLS-compliant.

CLS-compliant alternative
Microsoft.VisualBasic.Conversion.Oct(Int32)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(System::UInt32 Number);
[System.CLSCompliant(false)]
public static string Oct (uint Number);
static member Oct : uint32 -> string
Public Function Oct (Number As UInteger) As String

Parameters

Number
UInt32 UInt32 UInt32 UInt32

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(UInt16) Oct(UInt16) Oct(UInt16) Oct(UInt16)

Important

This API is not CLS-compliant.

CLS-compliant alternative
Microsoft.VisualBasic.Conversion.Oct(Int16)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(System::UInt16 Number);
[System.CLSCompliant(false)]
public static string Oct (ushort Number);
static member Oct : uint16 -> string
Public Function Oct (Number As UShort) As String

Parameters

Number
UInt16 UInt16 UInt16 UInt16

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(SByte) Oct(SByte) Oct(SByte) Oct(SByte)

Important

This API is not CLS-compliant.

CLS-compliant alternative
Microsoft.VisualBasic.Conversion.Oct(Byte)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(System::SByte Number);
[System.CLSCompliant(false)]
public static string Oct (sbyte Number);
static member Oct : sbyte -> string
Public Function Oct (Number As SByte) As String

Parameters

Number
SByte SByte SByte SByte

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(Byte) Oct(Byte) Oct(Byte) Oct(Byte)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(System::Byte Number);
public static string Oct (byte Number);
static member Oct : byte -> string
Public Function Oct (Number As Byte) As String

Parameters

Number
Byte Byte Byte Byte

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(Int64) Oct(Int64) Oct(Int64) Oct(Int64)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(long Number);
public static string Oct (long Number);
static member Oct : int64 -> string
Public Function Oct (Number As Long) As String

Parameters

Number
Int64 Int64 Int64 Int64

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(Int32) Oct(Int32) Oct(Int32) Oct(Int32)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(int Number);
public static string Oct (int Number);
static member Oct : int -> string
Public Function Oct (Number As Integer) As String

Parameters

Number
Int32 Int32 Int32 Int32

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(Int16) Oct(Int16) Oct(Int16) Oct(Int16)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(short Number);
public static string Oct (short Number);
static member Oct : int16 -> string
Public Function Oct (Number As Short) As String

Parameters

Number
Int16 Int16 Int16 Int16

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Oct(Object) Oct(Object) Oct(Object) Oct(Object)

Returns a string representing the octal value of a number.

public:
 static System::String ^ Oct(System::Object ^ Number);
public static string Oct (object Number);
static member Oct : obj -> string
Public Function Oct (Number As Object) As String

Parameters

Number
Object Object Object Object

Required. Any valid numeric expression or String expression.

Returns

A string representing the octal value of a number.

Exceptions

Examples

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)

Remarks

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.

See also

Applies to