Re: Converting .dat files to Paradox
Posted in 1993
If I try to reply to to barrett's posting I get "Host unknown" so I'm posting this instead: In <barrett.739591166@cc.gatech.edu> barrett@forge.gatech.edu (James Barrett) writes: >graeme@pyra.co.uk (Graeme Sargent) writes: >>When DECIMALTYPE numbers are stored in files, they are compressed or >>packed, as: >> First byte: >> top 1 bit is the sign of the number >> on = positive >> off = negative >> low 7 bits are the exponent in excess 64 format >> Remaining bytes: >> base 100 digits (in 100 complement format for negative numbers) >>The length in bytes of the packed DECIMALTYPE Number is 1 plus the >>number of base 100 digits. It can vary from 2 to 17 bytes. Zero is >>represented as 80,00,00,... (hex). I don't know what NULL looks like >>(00,00,00,... ???). I was right. NULL is 00,00,... >My zeroes are C0,00,00,00. Interesting! So are mine. Looks like they're using the second bit for something undocumented. >>Each byte holds 2 digits, located to the right or left of the decimal >>point. You cannot store a significant digit to the left of the decimal >>point in the same byte as a digit to the right of the decimal point. >>The decimal point is implied; it is not physically present in the data >>record. For a MONEY datatype (assuming you are not dealing with >>multi-currency) it is a fair bet that the scale factor is 2 (default). >Why then are some bytes 0A or 2B? What digit is "A"? For 10 or 43. "A" is 10. >Thanks for your help. Here's an example entry: C2 04 3D 00 00 00 00 00 00 >Any ideas why this is different from what you had? Apart from the "C" it's not. C2 04 3D comes out as $461.00 (assuming MONEY not DECIMAL) if we ignore the 2nd bit being set. Cheers, graeme --------------------------------------------------------------------------- -m------- Graeme Sargent Voice: +44 (0)252 373035 ---mmm----- Senior Database Consultant Fax : +44 (0)252 373135 -----mmmmm--- Pyramid Technology Ltd. Telex: Tell who??? -------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk --------------------------------------------------------------------------- We have the technology. The tricky bit is learning how to use it.