qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
HEX$, OCT$ Functions
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
HEX$ returns a hexadecimal string representation of a number.
OCT$ returns an octal string representation of a number.
 
HEX$(numeric-expression&)
OCT$(numeric-expression&)
 
    ■ 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."