![]() |
IncludeTrailingBackslash -> Copy (ReadDir)
Huhu Gemeinde :)
Ich versuche ein Verzeichnis Einzulesen. Habe dann auch eine Funktion gefunden im Netz, die ich auch verwenden wollte. Das Problem dabei ist, dass die Funktion "IncludeTrailingBackslash" benutzt. Und mein Compiler sagt mir da: "Warning: Systemabhängige Funktion". Dies wollte ich umgehen, indem ich die Funktion durch ein Copy Befehl ersetze. Aber leider ohne Erfolg. Ich hoffe jemand weis genaueres. Hier ist die Funktion mit den beiden Varianten:
Delphi-Quellcode:
Danke im Vorraus....
function ReadDir(Path, Mask: string; ShowPath: boolean): TStringlist;
var SRec: TSearchRec; tmp: string; begin // Variante 1 tmp := Copy(Path, (length(Path)-1) , length(Path)); if (not(tmp = '\')) then begin Path := Path + '\'; end; // Variante 2 //Path := IncludeTrailingBackslash(Path); result := TStringList.Create; try if FindFirst(Path + Mask, not faDirectory, SRec) <> 0 then exit; repeat case ShowPath of True : result.Add(Path + SRec.Name); False : result.Add(SRec.Name); end; until FindNext(SRec) <> 0; finally FindClose(SRec); end; end; Gruß, Real-TTX |
Re: IncludeTrailingBackslash -> Copy (ReadDir)
Ein Blick in die Hilfe hätte dir gezeigt, dass die Funktion durch
![]() |
Re: IncludeTrailingBackslash -> Copy (ReadDir)
Danke Vielmals für die schnelle Antwort und Kompetente Lösung.
Das ist mir nun echt peinlich :/ Hätte das unnötige Forum Thema auch sparen können.... Trotzdem, Vielen Dank |
Re: IncludeTrailingBackslash -> Copy (ReadDir)
Kein Problem, so findets der nächste...
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:52 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz