Autor Beitrag
mehmeh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 97

WIN XP
D5 Prof
BeitragVerfasst: Mi 07.12.05 11:46 
Hi,

ich möchte das mein Programm immer zur vollen Stunde etwas macht und sonst "schläft".
Hat jemand schon mal sowas gemacht oder nen Vorschlag?
Die Timer Komponente soll nach Möglichkeit nicht verwendet werden, gibt es da eine andere Komponente?

Danke
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 07.12.05 11:55 
Im "Idle" der Applikation könntest du die Uhrzeit prüfen.
Ivo@CoMRoK
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Fr 09.12.05 21:15 
Versuchmal nen Timer in dem du abfragst ob sich die System-Uhrzeit geändert hat.
Bsp:
Inen String kannstes umwandeln mit label1.Caption := FormatDateTime('hh:nn:ss', Time);
den Rest kannste dir susammenklamüsern.

mfg Ivo

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Fr 09.12.05 21:35 
Ich mach das ei mir (in einem Thread in etwa so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var nextround: TDateTime;
    teiler:integer;
begin
  teiler:=24; //24=1Std; 96=15min; 1440=1min
  nextround:=(Trunc(Now*teiler)+1)/teiler;
  if Now>=nextround then begin
      //Tu was
      end;