QBasic 1.1: OCT$ Function
Explanation
HEX$, OCT$ Functions
HEX$ returns a hexadecimal string representation of a number.
OCT$ returns an octal string representation of a number.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
HEX$(numeric-expression&) |
OCT$(numeric-expression&) |
Description / Parameter(s)
numeric-expression& |
Any numeric expression. The expression is rounded to an integer or long integer before it is evaluated. |
Example
INPUT x
a$ = HEX$ (x)
b$ = OCT$ (x)
PRINT x; "decimal is "; a$; " hexadecimal and "; b$; " in octal."