Skip navigation

Category Archives: Delphi

Grab error free code snip from PDF below:
fileSearch.txt — Notatnik

procedure TForm3.FileSearch(const PathName, FileName: string;
const InDir: boolean);
var
Rec: TSearchRec;
Path: string;
begin
Path := IncludeTrailingBackslash(PathName);
if FindFirst(Path + FileName, faAnyFile - faDirectory, Rec) = 0 then
try
repeat
ListBox1.Items.Add(Path + Rec.Name);
until FindNext(Rec) 0;
finally
FindClose(Rec);
end;

If not InDir then
Exit;

if FindFirst(Path + '*.*', faDirectory, Rec) = 0 then
try
repeat
if ((Rec.Attr and faDirectory) 0) and (Rec.Name '.') and
(Rec.Name '..') then
FileSearch(Path + Rec.Name, FileName, True);
until FindNext(Rec) 0;
finally
FindClose(Rec);
end;
end;
// procedure FileSearch

Nie wiem czemu WordPress kasuje z kodu znaki i załączam PDFa z poprawnym kodem.

Dostępny tutaj.

var
Dir : String;
begin
Dir := GetCurrentDir;
ExtractFilePath(Dir)+ExtractFileName(Dir)

Jak wypisać ścieżkę do pliku EXE z kodu programu.

%d blogerów lubi to: