Title: "VALuable Repair"
Reference: PC World August 1990
Author: Mike Yang
Files: XVAL.DOC, XVAL.BAS
Small differences between Microsoft QuickBASIC and interpreted BASIC
can drive programmers batty. For example, a quirk in the VAL
function, which is supposed to return the value of digits in a
string, works differently under BASIC and QuickBASIC.
The problem is, in BASICA and GWBASIC, the expressions VAL("100.0"),
VAL("100.0 %"), and VAL("100.0 &") return 100, just as they should.
But, under QuickBASIC, the last two of these functions produce "Type
mismatch" errors. This makes VAL anything but valuable for extracting
numbers from strings that contain the common characters % and &.
To get around the problem, use function XVAL in file XVAL.BAS. The
new function changes the offending characters to spaces before
passing a string to VAL. The function is useful for converting old
BASIC programs to QuickBASIC. Just replace every use of VAL with