Jump to content

Global Timer


skafy

Recommended Posts

I would like to have a timer witch will run every 30 seconds. It has to start when application starts and should not be attached to sessions. So my question is how can I use global variable Timer. I've put it in ServerModule but than I can't use it on mainModule data.

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  Timer1.Enabled:= True;
  Send:= False;
end;

procedure TUniServerModule.Timer1Timer(Sender: TObject);
var
  Time: TTime;
begin
  Time:= StrToTime(TimeToStr(Now));
  if Send then
  begin
    if (Time > StrToTime('12:12:00')) AND (Time < StrToTime('12:13:00')) then
      Send:= False;
  end
  else
  begin
    if (Time > StrToTime('12:11:00')) AND (Time < StrToTime('12:12:00')) then
      Send:=
end;
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...