![]() |
AW: Datei öffnen / Dateiname Teil variabel
Zitat:
Bist du dir sicher, dass du programmieren willst? |
AW: Datei öffnen / Dateiname Teil variabel
Zitat:
|
AW: Datei öffnen / Dateiname Teil variabel
Delphi-Quellcode:
program DateienSuchen;
{$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TDynStringArray = array of string; function GetFileArray( const ASearchStr : string ) : TDynStringArray; var LFileCount : Integer; LPath : string; LSearchRec : TSearchRec; begin LFileCount := 0; SetLength( Result, 10 ); LPath := ExtractFilePath( ASearchStr ); if FindFirst( ASearchStr, faAnyFile, LSearchRec ) = 0 then try repeat if LSearchRec.Attr and faDirectory = faDirectory then Continue; if LFileCount > High( Result ) then SetLength( Result, LFileCount + 10 ); Result[LFileCount] := LPath + LSearchRec.Name; Inc( LFileCount ); until FindNext( LSearchRec ) <> 0; SetLength( Result, LFileCount ); finally FindClose( LSearchRec ); end; end; procedure Test; var LFiles : TDynStringArray; LIdx : Integer; begin LFiles := GetFileArray( 'C:\*.*' ); for LIdx := Low( LFiles ) to High( LFiles ) do WriteLn( LFiles[LIdx] ); end; begin try Test; except on E : Exception do WriteLn( E.ClassName, ': ', E.Message ); end; ReadLn; end. |
AW: Datei öffnen / Dateiname Teil variabel
Danke. Ich werde mir das morgen mal alles durchschauen.
Wie gesagt bin ich ein wenig mit der Gesamtsituation überfordert :-D Und jetzt noch der lange code :lol: muss das erst mal nachvollziehen was das ganze überhaupt macht |
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:34 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-2025 by Thomas Breitkreuz