Unknown 6 anni fa
parent
commit
f2775dab5d
2 ha cambiato i file con 4 aggiunte e 17 eliminazioni
  1. 3 3
      Quick.Threads.pas
  2. 1 14
      Quick.Value.pas

+ 3 - 3
Quick.Threads.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Version     : 1.4
   Created     : 09/03/2018
-  Modified    : 14/01/2019
+  Modified    : 16/01/2019
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
@@ -1196,7 +1196,6 @@ end;
 
 procedure TScheduledTask.RunOnce;
 begin
-  ClearSchedule;
   fScheduleMode := TScheduleMode.smRunOnce;
   if fStartDate = 0.0 then fStartDate := Now();
   fNextExecution := fStartDate;
@@ -1220,6 +1219,7 @@ begin
     begin
       fLastExecution := Now();
       Inc(fExecutionTimes);
+      fFinished := True;
       Result := True;
     end;
   end
@@ -1368,7 +1368,7 @@ begin
     try
       for task in fTaskList do
       begin
-        if not task.IsFinished then
+        if (task.IsEnabled) and (not task.IsFinished) then
         begin
           if task.CheckSchedule then
           begin

+ 1 - 14
Quick.Value.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Version     : 1.4
   Created     : 07/01/2019
-  Modified    : 14/01/2019
+  Modified    : 15/01/2019
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
@@ -193,7 +193,6 @@ type
     function CastToPointer: Pointer;
     function CastToInterface: Pointer;
     function CastToVariant: Variant;
-    function CastToVarRec: TVarRec;
     function CastToCardinal : Cardinal;
     procedure SetAsString(const Value : string);
     {$IFNDEF NEXTGEN}
@@ -209,7 +208,6 @@ type
     procedure SetAsPointer(const Value: Pointer);
     procedure SetAsDateTime(const Value : TDateTime);
     procedure SetAsVariant(const Value: Variant);
-    procedure SetAsVarRec(const Value: TVarRec);
     procedure SetAsCardinal(const Value : Cardinal);
   public
     constructor Create(const Value: TVarRec);
@@ -228,7 +226,6 @@ type
     property AsInterface : Pointer read CastToInterface write SetAsPointer;
     property AsObject : TObject read CastToObject write SetAsObject;
     property AsVariant : Variant  read CastToVariant write SetAsVariant;
-    property AsVarRec : TVarRec read CastToVarRec write SetAsVarRec;
     property AsCardinal : Cardinal read CastToCardinal write SetAsCardinal;
     property AsDateTime : TDateTime read CastToDateTime write SetAsDateTime;
     //function AsType<T> : T;
@@ -507,11 +504,6 @@ begin
   end;
 end;
 
-function TFlexValue.CastToVarRec: TVarRec;
-begin
-
-end;
-
 procedure TFlexValue.Clear;
 begin
    if Pointer(fDataIntf) <> nil then fDataIntf := nil;
@@ -728,11 +720,6 @@ begin
   fDataType := TValueDataType.dtVariant;
 end;
 
-procedure TFlexValue.SetAsVarRec(const Value: TVarRec);
-begin
-
-end;
-
 {$IFNDEF NEXTGEN}
 procedure TFlexValue.SetAsWideString(const Value: WideString);
 begin