Browse Source

- implemented ControlsDisabled
- implemented TUpdateMode, TProviderFlags
- implemented TIndexDef, TIndexDefs
- added error message for if transaction of DB is not set
- removed some duplicate definitions
- restructured SetDataset
- implemented UpdateMode, ProviderFlags

michael 20 years ago
parent
commit
010ccd8554
1 changed files with 34 additions and 36 deletions
  1. 34 36
      fcl/db/bufdataset.inc

+ 34 - 36
fcl/db/bufdataset.inc

@@ -101,47 +101,45 @@ var x         : longint;
     NullMask     : pbyte;
     NullMask     : pbyte;
 
 
 begin
 begin
-  begin
-    Result := grOK;
-    case GetMode of
-      gmPrior :
-        if FIsBOF then
-          result := grBOF
-        else if FBCurrentRecord <= 0 then
+  Result := grOK;
+  case GetMode of
+    gmPrior :
+      if FIsBOF then
+        result := grBOF
+      else if FBCurrentRecord <= 0 then
+        begin
+        Result := grBOF;
+        FBCurrentRecord := -1;
+        end
+      else
+        begin
+        Dec(FBCurrentRecord);
+        FIsEof := false;
+        end;
+    gmCurrent :
+      if (FBCurrentRecord < 0) or (FBCurrentRecord >= RecordCount) then
+        Result := grError;
+    gmNext :
+      if FIsEOF then
+        result := grEOF
+      else if FBCurrentRecord >= (FBRecordCount - 1) then
+        begin
+        if getnextpacket > 0 then
           begin
           begin
-          Result := grBOF;
-          FBCurrentRecord := -1;
+          Inc(FBCurrentRecord);
+          FIsBof := false;
           end
           end
         else
         else
           begin
           begin
-          Dec(FBCurrentRecord);
-          FIsEof := false;
-          end;
-      gmCurrent :
-        if (FBCurrentRecord < 0) or (FBCurrentRecord >= RecordCount) then
-          Result := grError;
-      gmNext :
-        if FIsEOF then
-          result := grEOF
-        else if FBCurrentRecord >= (FBRecordCount - 1) then
-          begin
-          if getnextpacket > 0 then
-            begin
-            Inc(FBCurrentRecord);
-            FIsBof := false;
-            end
-          else
-            begin
-            FIsEOF := true;
-            result:=grEOF;
-            end
+          FIsEOF := true;
+          result:=grEOF;
           end
           end
-        else
-          begin
-          Inc(FBCurrentRecord);
-          FIsBof := false;
-          end;
-    end;
+        end
+      else
+        begin
+        Inc(FBCurrentRecord);
+        FIsBof := false;
+        end;
   end;
   end;
 
 
   if Result = grOK then
   if Result = grOK then