javadbf
javadbf copied to clipboard
Support for writing MEMO
Hello,
I have a quick question.
Is writing MEMO supported?
Memo writting is not supported. At the moment javadbf is mainly oriented on reading dbfs
Pull request are always welcome!
Do you have plans to make writing MEMO available any soon in javadbf? Thanks!
Do you have plans to make writing MEMO available any soon in javadbf? Thanks!
Sorry, I've no plans to improve writing support anytime soon. Pull request are always welcome
I wrote a "quick and dirty" class DBFWrite2 (derived from DBFWRITE) to make it possible. It certainly would need a better integration to javadbf and error checking.
To achieve this, I had to do some modifications in existing modules:
DBFMemoFile:
allow write access („r“ → „rw“)
routines to write the memo field
in close() set next free position
DBFField:
allow write for MEMO fields
DBFHeader:
getMdxFlag()
setMdxFlag() set the type of CDX index (byte 28)
setSignature() file type (byte 0)
I am setting the field displacement in the record from outside, like: // set displacement of field within record int disp = 1; for (int i = 1; i < fields.length; i++) { disp += fields[i-1].getLength(); fields[i].setDisplacement(disp); }
Most probably, this should be integrated into DBFWriter.setFields() DBFWriter2.zip
Thanks for your help. I'll review your code and try to include in the next release.