I am attempting to convert data from old Btrieve files into VFP. I found a great freeware tool that will dump any .BTR file out with an ASCII string for each record but the numeric fields are not converted. Using FoxPro it is very easy to parse the string into VFP fields but I am having trouble converting the 2 and 4 byte numeric fields.
For example two bytes containing the number 1 come out with values of 128 and 63. The number 6 comes out as 192 and 64. I can convert the 4 byte numbers using the following code which I have used in other conversions with no problems. However, the negitive numbers are all whacked.
mNum = (asc(fread(mHand,1)) ;
+ (asc(fread(mHand,1)) * 256) ;
+ (asc(fread(mHand,1)) * 65536))
x = fread(mHand,1)
if asc(x) >= 128
mNum = mNum - 167772.16
endif
Does anyone know where I can find code that will convert these numbers to decimal?
TIA
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn