Val: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
|
(No difference)
|
Revision as of 10:18, 17 January 2012
The Val internal function returns A$ expressed as a numeric value rather than a string.
Val(A$)
Comments and Examples
00010 LET A$ = "12" 00020 LET B$ = "34" 00030 PRINT VAL(A$)+VAL(B$)
Line 30 will print the number 46.
Related Functions
The inverse function of VAL(A$) is STR$(X). PRINT STR$(VAL("12")) will print the string value "12" without the quotation marks.
Technical Considerations
- The string in A$ can contain only spaces, digits, a plus sign, a minus sign, and a period; any other characters will generate a conversion error. These conversion errors can be trapped with the CONV error condition.