From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Global Method

Oct(value as Integer) As String

Supported on Desktop,Web,Console.

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



Part Type Description
result String The value passed converted to octal.
value Integer The number to be converted to octal.


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.


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.