random files from gwbasic 
Author Message
 random files from gwbasic

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???

--
Alan Chell
Maidstone, Kent, England
(44) 01622 744796



Tue, 28 Jan 2003 03:00:00 GMT  
 random files from gwbasic
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't understand.  Are these files just filled with "random"
numbers/characters?

 >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???
 >
 >
 >--
 >Alan Chell
 >Maidstone, Kent, England
 >(44) 01622 744796
 >
 >

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>
Comment: http://DannyJ.Come.To/PGP/

iQA/AwUBOZS4ourxnFAWPoHvEQIH5wCffUbCyPl+tpNoyiE2li4o/jrN0ZEAoOI2
B3P5qql0LqANPJ+XaA0qpIV4
=I+Ah
-----END PGP SIGNATURE-----



Tue, 28 Jan 2003 03:00:00 GMT  
 random files from gwbasic
On Fri, 11 Aug 2000 22:59:33 +0100, "alan.chell"

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???

Yes.  GWbasic used some MS standard for FP numbers.  You need to use
one of the versions of basic that understands both.  Read with old,
write a text file.  Read text file, write random with IEEE.
 --
arargh   (at enteract period com)             http://www.arargh.com
(Reply address points nowhere in an attempt to foil e-mail spammers.)


Tue, 28 Jan 2003 03:00:00 GMT  
 random files from gwbasic

Quote:
> I don't understand.  Are these files just filled with "random"
> numbers/characters?

When numbers were stored in old GW-BASIC files, they were usually packed
with MKS$, MKI$, MKD$  which converted them into strings which were the
binary representation of Microsoft's internal binary format.  Modern
versions of BASIC use IEEE format.  In QB, QBasic and PDS there are
functions to convert back and forth between the old and new formats but I
don't know about Visual BASIC.

Tom Lake



Wed, 29 Jan 2003 03:00:00 GMT  
 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???

I wrote a special article about that. Check it out:

http://dreael.catty.ch/Deutsch/BASIC-Knowhow-Ecke/Gleitkommazahlen.html

section "Die Darstellungsnorm IEEE 754". The remaining part of this article
shows you in detail how floating point numbers are stored.

Note that I'm still working on this BASIC knowhow corner, a French and
English translation will follow later, so please use
http://babelfish.altavista.com/translate.dyn at the moment if you don't
speak German.

Also useful is

http://dreael.catty.ch/Deutsch/BASIC-Knowhow-Ecke/MigrationProgramme....

section "Gleitkommazahlen in bin?ren Dateien"

           Andreas



Wed, 29 Jan 2003 03:00:00 GMT  
 random files from gwbasic
Dunno xactly what your problem is, but... Try saving the gwbasic program
with SAVE"PROG",A  Will save out an ASCII version of the program, and might
merge better in2 VB..

Steve!


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???

> --
> Alan Chell
> Maidstone, Kent, England
> (44) 01622 744796



Mon, 10 Feb 2003 03:00:00 GMT  
 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.



Mon, 10 Feb 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. GWBASIC (1/1) - gwbasic.zip [2/2]

2. GWBASIC (1/1) - gwbasic.zip [1/2]

3. reading binary file and writing into a random access file

4. convert sequential data file to random file

5. random access file - write to file

6. Random access files - having and finding multiple types of record in one file

7. When I merge 2 random access files the 2nd file doesn't line up correctly

8. Sequential files and random access files

9. conversion of gwbasic file to ASCII format

10. MENU SYSTEM FOR GWBASIC FILES

11. How to print a GWBasic file ?

12. GWBasic file formats and tools

 

 
Powered by phpBB® Forum Software