Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Indy FTP Problem (https://www.delphipraxis.net/46300-indy-ftp-problem.html)

w-lan 22. Mai 2005 13:34


Indy FTP Problem
 
Hallo!
Ich schreibe gerade eine Klasse , die FTP-Daten mit Hilfe von idFTP verarbeitet.
Leider bekomme ich keine Ergebnisse zurück und auch keine Fehler.
Nur folgende Warnung:
[Warnung] ewmsftp.pas(67): Variable 'box' ist möglicherweise nicht initialisiert worden


Was kann ich tun?

Vielen Dank im Voraus!

w-lan

Hier der Quelltext:



Code:
//FTP Info holen
function Tftp.getinfo(): TListbox;
var
  box : TListbox;
begin

  Fidftp1.list(box.Items,'',false);

  result := box;


end;

Ultimator 22. Mai 2005 13:37

Re: Indy FTP Problem
 
Du musst erst box "createn" ;)

Waldteufel 22. Mai 2005 13:38

Re: Indy FTP Problem
 
Hi.

Die Meldung stimmt. box ist nicht initialisiert worden ;-)
Ich würde aber eher eine TStringList zurückliefern. Warum den ganzen Listbox-Krempel noch drumherum? ;-)
Die temporäre Variable brauchst du übrigens nicht!

Delphi-Quellcode:
//FTP Info holen
function Tftp.getinfo(): TStringList;
begin
  result := TStringList.Create;
  Fidftp1.list(list,'',false);
end;

w-lan 22. Mai 2005 14:14

Re: Indy FTP Problem
 
Hallo,

vielen Dank für Eure Hilfe! :-D


Gruß

w-lan


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz