Hi,
Do anyone know how FlexFile II (.dbv) is working? Found some info
searching
Google, but very little useful... I also try to figure out how the 6 byte
pointer in the DBF-field references the record in the FlexFile...
What i have found is that the count-pointer is supposted to be 4 bytes at
0x54 and the offset and length is 4 bytes each at 0x84+8*Index. Is this
really correct? Can't get it to work... Using this code I get crazy
offsets
and lengths of the records.
procedure ReadRecord(iIndex: Integer);
var F: TFileStream; P: PChar; iCount, iOffset, iLength: Integer;
begin
F:=TFileStream.Create('mytab.dbv');
F.Seek($54,soFromBeginning);
F.Read(iCount,4); // Read the integer record count
if iIndex <= iCount then
begin
F.Seek($84+8*iIndex); // Go to record of data
F.Read(iOffset,4); // Read offset of record
F.Read(iLength,4); // Read length of record
F.Seek(iOffset,soFromBeginning); // Seek data of first record
GetMem(P,iLength+1);
F.Read(P^,iLength); // Read into buffer
ShowMessage(string(P));
FreeMem(P);
end else
ShowMessage('Record not found');
F.Free;
end;
Any help, please?
Best regards,
Roy


|