Autor Beitrag
thebug
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 49



BeitragVerfasst: Di 03.06.03 16:26 
kann mir jemand sagen was hier falsch ist???
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Timer1Timer(Sender: TObject);
var data:file of string[40];txt,alt:shortstring;
begin
assignfile(data,config.verbindung);
reset(data);
read(data,txt);
closefile(data);
if txt<>alt then
begin
memo1.Lines.Add(text);
alt:=txt;
end;
end;

read(data,txt);
Fehler: Inkompatible Typen

Thanx
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 03.06.03 17:10 
Hallo,
shortstring und String[40] ist nicht das selbe.
Versuche es mal so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
TYPE
  tSt40 = STRING[40];
[...]
procedure TForm1.Timer1Timer(Sender: TObject);
  var 
    data : file of tSt40;
    txt, alt : tSt40;
begin
  assignfile(data,config.verbindung);
  reset(data);
  read(data,txt);
  closefile(data);
  if txt<>alt then begin
    memo1.Lines.Add(text);
    alt:=txt;
  end;
end;


Gruß
Klabautermann
thebug Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 49



BeitragVerfasst: Di 03.06.03 17:34 
danke

_________________
Einsicht ist der beste Weg zur Besserung