Category : BASIC Source Code
Archive   : LINKBAS.ZIP
Filename : XVAL.DOC

 
Output of file : XVAL.DOC contained in archive : LINKBAS.ZIP

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
XVAL.


  3 Responses to “Category : BASIC Source Code
Archive   : LINKBAS.ZIP
Filename : XVAL.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/