Oct, Oct$ Functions

Named Arguments

No

Syntax

Oct(number)


number

Use: Required

Data Type: Numeric or String

Number or string representation of a number to convert.

Return Value

A Variant of subtype String or a String

Description

Returns the octal value of a given number.

Rules at a Glance

  • If number isn't already a whole number, it's rounded to the nearest whole number before being evaluated.

  • If number is Null, Oct returns Null.

  • If number is the special Empty variant, Oct returns (zero).

  • Oct returns up to 11 octal characters.

  • Oct returns a variant string, while Oct$ returns a string data type.

Programming Tips and Gotchas

You can also use literals in your code to represent octal numbers by appending &O to the relevant octal value. For example, 100 decimal has the octal representation &O144. The following two statements each assign an octal value to a variable:

lngOctValue1 = &O200     ' Assigns 128
lngOctValue2 = "&O" & Len(dblNumber)     ' Assigns 8

See Also

Hex, Hex$ Function
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.66.241