pascal 'real' data to vb 'double' 
Author Message
 pascal 'real' data to vb 'double'

Been trying to find an answer to this for ages unsuccessfully..

We have a data file on disc, written in Pascal originally, which has
some "real" (6-byte floating point number) numbers written in it as a
set of 6 consecutive bytes..

Because of the way the data is stored, we have to read it into a
byte-array in VB.. Now we need to get the numbers out of the byte
array, and into a Double format VB number..

Just can't figure out how to do it.. Anyone have any ideas?

Thanks,
Aaron



Sat, 07 Feb 2004 22:05:10 GMT  
 pascal 'real' data to vb 'double'


Quote:
> Been trying to find an answer to this for ages unsuccessfully..

> We have a data file on disc, written in Pascal originally, which has
> some "real" (6-byte floating point number) numbers written in it as
a
> set of 6 consecutive bytes..

> Because of the way the data is stored, we have to read it into a
> byte-array in VB.. Now we need to get the numbers out of the byte
> array, and into a Double format VB number..

> Just can't figure out how to do it.. Anyone have any ideas?

Get the TP 5.5 compiler from the Borland Museum, and make a conversion
program. Read the file containing 'Real' variables, write a file
containing 'Single' or 'Double' and have VB chew on that instead.

TP versions 4 and newer understand the floating point formats used by
the FPU, as well as still being able to handle the 'real' format which
came from before the FPU was a twinkle in its mother's eye.

FP



Sat, 07 Feb 2004 22:27:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. format for 'real'

2. type field ''money''

3. IndexDefs.Add('Help','Please',[ixD2WorksGreat, ixD3Errors])

4. 'Circular data links' hard to find

5. TQuery 'live' data sets

6. data-aware component on 'other' form

7. 'Incompatible types 'string' and 'Tdbedit''

8. Replace 'keystack''

9. Don't trust in 'trunc'

10. 'C' to PASCAL translator

11. Pascal to 'C' FAQ

12. Looking for equivalent to 'friend'(C++) in object pascal

 

 
Powered by phpBB® Forum Software