瀏覽代碼

* Implemented TNumericField.GetAsboolean

git-svn-id: trunk@11897 -
joost 17 年之前
父節點
當前提交
422c45ce3e
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 1 0
      packages/fcl-db/src/base/db.pas
  2. 5 0
      packages/fcl-db/src/base/fields.inc

+ 1 - 0
packages/fcl-db/src/base/db.pas

@@ -506,6 +506,7 @@ type
     procedure RangeError(AValue, Min, Max: Double);
     procedure SetDisplayFormat(const AValue: string);
     procedure SetEditFormat(const AValue: string);
+    function GetAsBoolean: Boolean; override;
   public
     constructor Create(AOwner: TComponent); override;
   published

+ 5 - 0
packages/fcl-db/src/base/fields.inc

@@ -1288,6 +1288,11 @@ begin
     end;
 end;
 
+function TNumericField.GetAsBoolean: Boolean;
+begin
+  Result:=GetAsInteger<>0;
+end;
+
 { ---------------------------------------------------------------------
     TLongintField
   ---------------------------------------------------------------------}