Skip to main content
Previous sectionNext section

Oct

Returns a string representing the octal value of a number.

Synopsis

Oct(number)

Arguments

The number argument is any valid expression that resolves to a positive or negative number. If number is a decimal fraction, it is truncated to a whole number before being evaluated.

Description

The Oct function converts a number from decimal (base 10) to octal (base 8). To convert a number from octal to decimal, represent octal numbers directly by preceding numbers in the proper range with &O For example, &O10 is the octal notation for decimal 8.

If Number Is Oct Returns
Empty Zero (0).
Any other number Up to 11 octal characters.

Examples

The following example uses the Oct function to return the octal value of a decimal (base-10) number:

Println Oct(4)     ' Returns 4.
Println Oct(8)     ' Returns 10.
Println Oct(459)   ' Returns 713.
Copy code to clipboard

The following example uses the &O prefix to return the decimal (base-10) value for an octal number:

Println &O4     ' Returns 4.
Println &O10    ' Returns 8.
Println &O713   ' Returns 459.
Copy code to clipboard

See Also