- This topic has 1 reply, 1 voice, and was last updated 1 year, 11 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
hi,kim
The first time starting SE is executed and then stopping SE is called, in this case, when starting SE is executed again, the scheduler does not execute.
code:
unit Form.Main;
type
TForm18 = class(TForm)
private
KeepLiveScheduledEvent :IkbmMWScheduledEvent;
procedure CreateSE;
procedure StartSE;
procedure StopSE;
public
{ Public declarations }
end;
var
Form18: TForm18;
implementation
{$R *.fmx}
{ TForm18 }
procedure TForm18.CCButton1Click(Sender: TObject);
begin
StartSE;
end;
procedure TForm18.CCButton2Click(Sender: TObject);
begin
StopSE;
end;
procedure TForm18.CreateSE;
begin
KeepLiveScheduledEvent := Scheduler.Schedule(
function(const AScheduledEvent: IkbmMWScheduledEvent): Boolean
begin
TThread.Synchronize(nil,procedure
begin
Text1.Text:= FormatDateTime(‘yyyy-mm-dd hh:nn:ss’,Now);
end)
end)
.EverySecond(1);
end;
procedure TForm18.FormCreate(Sender: TObject);
begin
CreateSE;
end;
procedure TForm18.StartSE;
begin
KeepLiveScheduledEvent.Activate(True);
end;
procedure TForm18.StopSE;
begin
KeepLiveScheduledEvent.Activate(False);
end;
end.
kbmMW Version: 5.23.00