[fpc-devel] Sdf / Fixed maximum line length flexibilization

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sun Sep 7 14:09:37 CEST 2008


Hello,

Sdf / Fixed datasets have a constant for the maximum line size, but
this one is too small for me, so I changed the constant into a field
in the class so it can be customized. I tested and it works for me.

I just thougth someone may have a better idea, so I am showing the
patch here for review and will apply in some days if noone has a
better idea.

Index: sdfdata.pp
===================================================================
--- sdfdata.pp	(revision 11718)
+++ sdfdata.pp	(working copy)
@@ -125,9 +125,6 @@
 uses
   DB, Classes, SysUtils;

-const
-  MAXSTRLEN = 250;
-
 type
 //-----------------------------------------------------------------------------
 // TRecInfo
@@ -199,6 +196,7 @@
     function BufToStore(Buffer: PChar): String; virtual;
     function StoreToBuf(Source: String): String; virtual;
   public
+    MAXSTRLEN: Integer;
     constructor Create(AOwner: TComponent); override;
     destructor  Destroy; override;
     function  GetFieldData(Field: TField; Buffer: Pointer): Boolean; override;
@@ -274,6 +272,7 @@
 //-----------------------------------------------------------------------------
 constructor TFixedFormatDataSet.Create(AOwner : TComponent);
 begin
+ MAXSTRLEN := 250;
  FFileMustExist  := TRUE;
  FLoadfromStream := False;
  FRecordSize   := 0;



More information about the fpc-devel mailing list