I have a datalog file that has an extension .DAT, but is actually a DBF table. One of the fields I want from this table is defined as a C8 field, but is actually a floating point value stored in 64 bits (much like IEE-754). I was previously using the May 2000 release of TDBF which was almost working. I used FieldByName('Value').AsString, however some byte values were being read incorrectly (bytes > 127).
I just downloaded and got the new version working in D4 (thanks to several other forum messages). Now the FieldByName('Value').AsString is returning a null string for all these fields. It appears to stop reading after the first $00 is encountered. I have also tried using the GetFieldData method, but this stops reading after the first $00 as well. I found a similar forum message at http://sourceforge.net/forum/message.php?msg_id=2768447 where mdv suggested:
Instead of: (~line 1528)
StrLCopy(Dst, Src, FieldSize);
Move(Src^, Dst^, FieldSize);
Does that work ? That will copy $0 bytes too.
I have tried this but then I seem to get an error when reading the time field (also a C8 field) that reads extra characters at the end.
Any suggestions on the best way to read these fields?
I have attached the D4 code I currently have, along with some datalog samples (the DAT files are actually CSV files, there is a csv files with the DAT values converted to a C8 field).
Log in to post a comment.