Oct Function

Purpose

Converts an integer expression to octal representation.

Syntax

$ = Oct[$](m[,n])

m, n:integer expression

Description

After conversion the octal representation of integer expression m is returned as a plain string. The parameter n is optional and determines how many places should be used. If n is greater than the number of places needed to represent m the converted number is padded with leading zeros.

Example

Debug.Show

Trace Oct$(17)     //prints 21

Trace Oct$(25, 6//prints 000031

Remarks

Without the optional $ character the function still returns a String data type and not a Variant.

See Also

String, Bin$(), Hex$(), Dec$()

{Created by Sjouke Hamstra; Last updated: 20/10/2014 by James Gaite}