Oct

From Xojo Documentation

Method

Oct(value as Integer) As String

Supported on Desktop,Web,Console.

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

Syntax

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.

Examples

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"

See Also

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