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.
STR$, VAL Function
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
STR$ returns a string representation of a number.
VAL converts a string representation of a number to a number.
 
STR$(numeric-expression)
VAL(stringexpression$)
 
    ■ numeric-expression    Any numeric expression.
    ■ stringexpression$     A string representation of a number.
 
Example:
    PRINT "Decimal 65 is represented in hexadecimal as ";
    PRINT "&H" + LTRIM$(STR$(41))
    PRINT VAL(RIGHT$("Microsoft 1990", 4))