Browse Source

patch to enable RecNo and DisplayFormat

michael 20 years ago
parent
commit
1d15fe4f31
5 changed files with 26 additions and 14 deletions
  1. 2 2
      fcl/db/Makefile
  2. 12 3
      fcl/db/database.inc
  3. 6 3
      fcl/db/db.pp
  4. 5 5
      fcl/db/fields.inc
  5. 1 1
      fcl/db/sqldb/testsqldb.pp

+ 2 - 2
fcl/db/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2004/11/26]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2004/11/28]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom morphos netwlibc
+MAKEFILETARGETS=linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) sunos qnx
 UNIXs = linux $(BSDs) sunos qnx
 LIMIT83fs = go32v2 os2
 LIMIT83fs = go32v2 os2

+ 12 - 3
fcl/db/database.inc

@@ -37,7 +37,8 @@ procedure TDataBase.Loaded;
 
 
 begin
 begin
   inherited;
   inherited;
-  if FOpenAfterRead then SetConnected(true);
+  if FOpenAfterRead then
+    SetConnected(true);
 end;
 end;
 
 
 procedure TDataBase.SetConnected (Value : boolean);
 procedure TDataBase.SetConnected (Value : boolean);
@@ -53,7 +54,12 @@ begin
         exit;
         exit;
         end
         end
       else
       else
-        DoInternalConnect;
+//        try
+          DoInternalConnect;
+//        except
+//          on e: EDatabaseError do DoInternalDisconnect;
+      //    raise;
+//        end; {try}
       end
       end
     else
     else
       begin
       begin
@@ -438,7 +444,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.8  2004-11-05 08:32:02  michael
+  Revision 1.9  2004-12-05 00:05:38  michael
+  patch to enable RecNo and DisplayFormat
+
+  Revision 1.8  2004/11/05 08:32:02  michael
   TBufDataset.inc:
   TBufDataset.inc:
     - replaced Freemem by Reallocmem, Free by FreeAndNil
     - replaced Freemem by Reallocmem, Free by FreeAndNil
 
 

+ 6 - 3
fcl/db/db.pp

@@ -833,7 +833,7 @@ type
     FOnFilterRecord: TFilterRecordEvent;
     FOnFilterRecord: TFilterRecordEvent;
     FOnNewRecord: TDataSetNotifyEvent;
     FOnNewRecord: TDataSetNotifyEvent;
     FOnPostError: TDataSetErrorEvent;
     FOnPostError: TDataSetErrorEvent;
-    FRecNo: Longint;
+//    FRecNo: Longint;
     FRecordCount: Longint;
     FRecordCount: Longint;
 //    FRecordSize: Word;
 //    FRecordSize: Word;
     FIsUniDirectional: Boolean;
     FIsUniDirectional: Boolean;
@@ -1025,7 +1025,7 @@ type
     property Modified: Boolean read FModified write SetModified;
     property Modified: Boolean read FModified write SetModified;
     property IsUniDirectional: Boolean read FIsUniDirectional write FIsUniDirectional default False;
     property IsUniDirectional: Boolean read FIsUniDirectional write FIsUniDirectional default False;
     property RecordCount: Longint read GetRecordCount;
     property RecordCount: Longint read GetRecordCount;
-    property RecNo: Longint read FRecNo write FRecNo;
+    property RecNo: Longint read GetRecNo write SetRecNo;
     property RecordSize: Word read GetRecordSize;
     property RecordSize: Word read GetRecordSize;
     property State: TDataSetState read FState;
     property State: TDataSetState read FState;
     property Fields : TFields read FFieldList;
     property Fields : TFields read FFieldList;
@@ -1610,7 +1610,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.29  2004-12-04 22:44:24  michael
+  Revision 1.30  2004-12-05 00:05:38  michael
+  patch to enable RecNo and DisplayFormat
+
+  Revision 1.29  2004/12/04 22:44:24  michael
     * Patch from Joost van der Sluis
     * Patch from Joost van der Sluis
     - implemented TBCDFields
     - implemented TBCDFields
     - adapted for the changes in TBuffDataset
     - adapted for the changes in TBuffDataset

+ 5 - 5
fcl/db/fields.inc

@@ -860,11 +860,9 @@ begin
     fmt:=FDisplayFormat
     fmt:=FDisplayFormat
   else
   else
     fmt:=FEditFormat;
     fmt:=FEditFormat;
-{  // no formatFloat yet
   If length(fmt)<>0 then
   If length(fmt)<>0 then
     AText:=FormatFloat(fmt,L)
     AText:=FormatFloat(fmt,L)
   else
   else
-}
     Str(L,AText);
     Str(L,AText);
 end;
 end;
 
 
@@ -1054,11 +1052,10 @@ begin
     Fmt:=FDisplayFormat
     Fmt:=FDisplayFormat
   else
   else
     Fmt:=FEditFormat;
     Fmt:=FEditFormat;
-{  // No formatfloat yet
+
   If fmt<>'' then
   If fmt<>'' then
     TheText:=FormatFloat(fmt,E)
     TheText:=FormatFloat(fmt,E)
   else
   else
-}
     TheText:=FloatToStrF(E,ffgeneral,FPrecision,0);
     TheText:=FloatToStrF(E,ffgeneral,FPrecision,0);
 end;
 end;
 
 
@@ -1930,7 +1927,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2004-12-04 22:43:56  michael
+  Revision 1.18  2004-12-05 00:05:38  michael
+  patch to enable RecNo and DisplayFormat
+
+  Revision 1.17  2004/12/04 22:43:56  michael
     - implemented TBCDFields
     - implemented TBCDFields
 
 
   Revision 1.16  2004/11/30 21:18:34  michael
   Revision 1.16  2004/11/30 21:18:34  michael

+ 1 - 1
fcl/db/sqldb/testsqldb.pp

@@ -24,7 +24,7 @@ program testsqldb;
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 
 
 {$define pqconnection}
 {$define pqconnection}
-{$define MySQLConnection}
+{ define MySQLConnection}
 {$define IBConnection}
 {$define IBConnection}
 
 
 uses
 uses