Autor Beitrag
nilsener1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52

Win 98, XP
D4 prof.
BeitragVerfasst: Sa 20.11.04 20:23 
Hallo,

ich habe die folgende procedure zur Übertragung einer Datei auf einen FTP-Server, die aus einer Timer-Routine aufgerufen wird:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
procedure FTP_Abwicklung(steuerung : FTP_Platte);
Begin
transmission_flag:=true;
Form1.Label53.Visible:=true;
Form1.Label53.Color:=clred;
Form1.Label53.Caption:='Try to connect';
try Form1.NMFTP1.Connect;
 except
  on E: ESockError do
  begin
  MessageDlg('FTP-Host nicht erreichbar!', mtError, [mbOk], 0);
  end
 end;

if Form1.NMFTP1.Connected = True then
 begin
 Form1.NMFTP1.Mode(MODE_IMAGE);
 Form1.Label53.Color:=cllime;
 Form1.Label53.Caption:='Connected';
 Form1.Label54.Color:=cllime;
 Form1.Label54.Visible:=true;
 Form1.Label54.Caption:='Übertragung läuft';
 if steuerung = schreiben
  then Form1.NMFTP1.upload('c:\test001.dat','test001.dat');
 if steuerung = laden
  then Form1.NMFTP1.download('test001.dat','c:\test001.dat');
 end;
try Form1.NMFTP1.Disconnect; except end;
Form1.Label53.Caption:='Disconnected';
end;


Problem ist, dass das Programm nach Ablauf der FTP-Abwicklung nicht an die entsprechende Sprungmarke in der Timer-Routine zurückspring. Das Disconnect wird noch sauber durchgeführt, das folgende 'Form1.Label53.Caption:='Disconnected';' jedoch nicht mehr. Komischer Weise läuft die Timer-Routine nach Ausführung von FTP-Abwicklung weiter, jedoch nicht bei der Sprungmarke, sondern vermutlich vom Anfang.

Jemand eine Idee wo das Problem ist ?

Gruss nilsener