I added EditMask property to TField in fpc trunk. To be Delphi compatible i created a type TEditMask in MaskUtils unit, so the need to put MaskUtils in the uses of db.

After trying to compile (make install) the following error occurs (maskutils not found). Some notes
- fcl-base is a dependency in the Makefile of fcl-db
- the unit maskutils is compiled (.ppu and .o files are created in fcl-base/units)

make -C src/sdf smart
make[4]: Entering directory `D:/repositories/fpc_trunk/packages/fcl-db/src/sdf'
make all LINKSMART=1 CREATESMART=1
make[5]: Entering directory `D:/repositories/fpc_trunk/packages/fcl-db/src/sdf' D:/repositories/fpc_trunk/compiler/ppc386.exe -XX -CX -Ur -Xs -O2 -n -FuD:/repos itories/fpc_trunk/rtl/units/i386-win32 -FE. -FUD:/repositories/fpc_trunk/package
s/fcl-db/units/i386-win32 -gl -di386 -dRELEASE sdfdata.pp
Fatal: Can't find unit maskutils used by db
Fatal: Compilation aborted
make[5]: *** [sdfdata.ppu] Error 1
make[5]: Leaving directory `D:/repositories/fpc_trunk/packages/fcl-db/src/sdf'
make[4]: *** [fpc_smart] Error 2
make[4]: Leaving directory `D:/repositories/fpc_trunk/packages/fcl-db/src/sdf'
make[3]: *** [src/sdf_smart] Error 2
make[3]: Leaving directory `D:/repositories/fpc_trunk/packages/fcl-db'
make[2]: *** [fcl-db_smart] Error 2
make[2]: Leaving directory `D:/repositories/fpc_trunk/packages'
make[1]: *** [packages_smart] Error 2
make[1]: Leaving directory `D:/repositories/fpc_trunk'
make: *** [build-stamp.i386-win32] Error 2

Compiling under windows xp with fpc240

Patch follows:
Index: packages/fcl-base/src/maskutils.pp
===================================================================
--- packages/fcl-base/src/maskutils.pp  (revision 15177)
+++ packages/fcl-base/src/maskutils.pp  (working copy)
@@ -63,8 +63,8 @@
   );
 
   TParseState = set of TStepState;
-
-
+  
+  TEditMask = type string;
 
 { TMaskUtils }
 
Index: packages/fcl-db/src/base/db.pas
===================================================================
--- packages/fcl-db/src/base/db.pas     (revision 15177)
+++ packages/fcl-db/src/base/db.pas     (working copy)
@@ -22,7 +22,7 @@
 
 interface
 
-uses Classes,Sysutils,Variants,FmtBCD;
+uses Classes,Sysutils,Variants,FmtBCD,MaskUtils;
 
 const
 
@@ -271,6 +271,7 @@
     FDefaultExpression : String;
     FDisplayLabel : String;
     FDisplayWidth : Longint;
+       FEditMask: TEditMask;
     FFieldKind : TFieldKind;
     FFieldName : String;
     FFieldNo : Longint;
@@ -401,6 +402,8 @@
     property DataType: TFieldType read FDataType;
     property DisplayName: String Read GetDisplayName;
     property DisplayText: String read GetDisplayText;
+       property EditMask: TEditMask read FEditMask write FEditMask;
+       property EditMaskPtr: TEditMask read FEditMask;
     property FieldNo: Longint read FFieldNo;
     property IsIndexField: Boolean read FIsIndexField;
     property IsNull: Boolean read GetIsNull;
@@ -472,7 +475,8 @@
     property Transliterate: Boolean read FTransliterate write FTransliterate;
     property Value: String read GetAsString write SetAsString;
   published
-    property Size default 20;
+    property EditMask;
+    property Size default 20;  
   end;
 
 { TWideStringField }
@@ -496,6 +500,8 @@
   public
     constructor Create(aOwner: TComponent); override;
     property Value: WideString read GetAsWideString write SetAsWideString;
+  published    
+       property EditMask;
   end;
 
 
@@ -698,6 +704,7 @@
     property Value: TDateTime read GetAsDateTime write SetAsDateTime;
   published
     property DisplayFormat: string read FDisplayFormat write SetDisplayFormat;
+       property EditMask;
   end;
 
 { TDateField }
@@ -905,6 +912,8 @@
   public
     constructor Create(AOwner: TComponent); override;
     property AsGuid: TGUID read GetAsGuid write SetAsGuid;
+  published
+    property EditMask;  
   end;
 
 { TIndexDef }
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to