
random files from gwbasic
Quote:
> I am trying to read old gwbasic random files into visual basic
> I can read the strings and integers but the double precision numbers to
> have the correct value
> Can anybody help
> I beleive there could require a conversion from DOS to IEEE???
BASICA / GW-BASIC used the old Microsoft Binary Format for floating - point
numbers. QuickBasic and later BASICs use the IEEE format of the Intel
coprocessors. QuickBasic has functions to convert between the formats, so VB
probably does.
The QuickBasic compiler accepts the /MBF switch, which forces the compiler to
use the old emulation library. Recompiling an old GW-BASIC program (saved with
the ,A option) makes an .exe that works with the old files.
A better solution would be to write a little program that reads the files in
BINARY mode, treating the numbers as eight - byte strings, and uses the
CVDMBF() function to convert the strings to IEEE - format DOUBLEs. You can
then write the numbers to a new file (or the old one, but I would save that for
backup).
--------------------------------------------------------------------------
--------------
If it's spam, it's a scam. Don't do business with Net abusers.