QBasic 1.1: STR$ Function
Explanation
STR$, VAL Function
STR$ returns a string representation of a number.
VAL converts a string representation of a number to a number.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
STR$(numeric-expression) |
VAL(stringexpression$) |
Description / Parameter(s)
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))