How to write binary data to string field : TDbf lazarus / 16-Databases ---------------------------------------------------------------------- j111 · 2008-05-27 18:58 Hello. I have created a sample dbf table with one field of Char type and 2 bytes length. And write sample code below. And when I write value of my Word variable to it, TDBf corrupts data. I saw at dbf in hex editor and i think that 00x0 chars it translates to 20x0. How Can I write any data I want without processing them according to field data type? Code: [Select] program testbin; {$mode objfpc}{$H+} uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF}   Classes,   Dbf   { add your units here }; var   f : TDbf;   si : word; begin   si := 1;   f := TDbf.Create(nil);   f.TableName := C:\lazarus_projects\test_write_bin_val_str_field\test.dbf';   f.Open();   f.Append();   f.Fields[0].SetData(@si,True);   f.Post();   f.Close();   end.