Autor Beitrag
110022
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Mi 31.10.07 15:39 
was ist hier dran falsch??
die Bedingung funktioniert nicht, warum??
es kommt die meldung
ausblenden Delphi-Quelltext
1:
[Fehler] Unit1.pas(38): Inkompatible Typen: 'String' und 'TDateTime'					

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
begin
Label1.caption := TimeToStr(Time)+' Uhr';
Label2.caption := DateToStr(Date);
if time >='15:35:00' then showmesage('Hallo');
end;
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Mi 31.10.07 15:57 
Weil du Time vom Typ TDateTime mit einem String vergleichen willst.. sagt ja der Compiler auch.

Du musst die variable Time vom Typ TDateTime bzw. TTime in einen String umwandeln..
ausblenden Delphi-Quelltext
1:
  if TimeToStr(time) >= '15:35:00' then showmesage('Hallo');					

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.