Bläddra i källkod

* Do not search for a semicolon anymore to check if there is more then one field in FieldValues

git-svn-id: trunk@10670 -
joost 17 år sedan
förälder
incheckning
a681f946f8
1 ändrade filer med 10 tillägg och 10 borttagningar
  1. 10 10
      packages/fcl-db/src/base/dataset.inc

+ 10 - 10
packages/fcl-db/src/base/dataset.inc

@@ -2144,18 +2144,18 @@ function TDataset.GetFieldValues(Fieldname: string): Variant;
 var i: Integer;
     FieldList: TList;
 begin
-  if Pos(';', FieldName) <> 0 then begin
-    FieldList := TList.Create;
-    try
-      GetFieldList(FieldList, FieldName);
+  FieldList := TList.Create;
+  try
+    GetFieldList(FieldList, FieldName);
+    if FieldList.Count>1 then begin
       Result := VarArrayCreate([0, FieldList.Count - 1], varVariant);
       for i := 0 to FieldList.Count - 1 do
         Result[i] := TField(FieldList[i]).Value;
-    finally
-      FieldList.Free;
-    end;
-  end else
-    Result := FieldByName(FieldName).Value
+    end else
+      Result := FieldByName(FieldName).Value;
+  finally
+    FieldList.Free;
+  end;
 end;
 
 procedure TDataset.SetFieldValues(Fieldname: string; Value: Variant);
@@ -2164,7 +2164,7 @@ var
   i : Integer;
   FieldList: TList;
 begin
-  if Pos(';', FieldName) <> 0 then begin
+  if VarIsArray(Value) then begin
     FieldList := TList.Create;
     try
       GetFieldList(FieldList, FieldName);