title: ShapefileII.pas needs help Delphi: Shapelib.dll
body: <p>has anyone had problems with the use of the pascal version of the file 'ShapefileII.pas'?
  The OSGEO maintain a DLL to manage shapefile and DBF associated file (<a href="https://github.com/OSGeo/shapelib" rel="nofollow noreferrer">https://github.com/OSGeo/shapelib</a>).</p>
  <p>I'm trying to create a shp file and the associated .DBF file using Delphi-10.3-Rio. I can create the SHP and DBF file, but I can not add/updade string field data to the DBF file.</p>
  <p>I used the steps described in the example file 'dbfadd.c' using the function 'DBFWriteStringAttribute' and 'DBFWriteIntegerAttribute'.</p>
  <p>The function does not return any errors, but the string field in DBF file is not updated.</p>
  <p>I know that is related to differences PChar C++ and PAnsichar in Delphi 10.3 code.</p>
  <p>The Delphi equivalent from C++ is:</p>
  <p>function DBFWriteIntegerAttribute(hDBF: DBFHandle;
  iShape: LongInt; iField: LongInt; nFieldValue: LongInt): LongInt; cdecl;</p>
  <p>function DBFWriteStringAttribute(hDBF: DBFHandle; iShape: LongInt; iField: LongInt; pszFieldValue: PAnsiChar{PChar}): LongInt; cdecl;</p>
  <p>//c++ DLL code</p>
  <p>{
  function DBFWriteIntegerAttribute(hDBF: DBFHandle;iShape: LongInt; iField: LongInt; nFieldValue: LongInt): LongInt; cdecl;</p>
  <p>DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
  const char * pszFieldValue );
  int}</p>
  <p>Please, can anyone help me?
  Here my code:</p>
  <p>//open dbf file and add/update data</p>
  <p>FDBFHandle := DBFOpen(pAnsichar(FileNameDBF), pAnsichar('r+b')); //open a DBF file created</p>
  <p>if FDBFHandle = nil then
  exit;</p>
  <p>iRecord:= DBFGetRecordCount(FDBFHandle); // get record number</p>
  <p>DBFWriteIntegerAttribute(FDBFHandle, iRecord, 0, 99 ); //works fine update first field</p>
  <p>DBFWriteStringAttribute (FDBFHandle, iRecord, 1, PAnsichar('TEST' ));//NOT WORK BUT RETURN TRUE AND SAVE VALUE '0' TO FIELD</p>
  <p>//Using PAnsistring also not work</p>
  <p>DBFClose(FDBFHandle);</p>