Blaise Pascal Magazine
Blaise Pascal Magazine
BY HEIKO ROMPEL
starter
expert
// Wenn die Stringliste nil ist oder aPath oder aFind nicht angegeben ist dann raus
// If the string list is nil or the aPath or aFind is not found then exit
If (aPath = '') or (aFindMask = '') or Not Assigned (aResult) Then Exit;
// Wenn am Ende der Pfadangabe noch kein \ steht, dieses hinzufgen
// If at the end of the path there is no \ add it
// (Oder die Funktion IncludeTrailingPathDelimiter aus der Unit SysUtils.pas verwenden)
// Otherwise use the function IncludeTrailingPathDelimiter from unit SysUtils.pas
If aPath[Length (aPath)] <> '\' Then aPath := aPath + '\';
old:
// Search the current directory for the file
If FindFirst (aPath + aFindMask, faAnyFile,
FindRec) = 0 Then
new:
// Search the current directory for the file
If FindFirstUTF8(aPath + aFindMask,
faAnyFile, FindRecord) = 0 Then
old:
Until FindNext (FindRec) <> 0;
FindClose (FindRec);
new:
Until FindNextUTF8 (FindRecord) <> 0;
FileUtil.FindCloseUTF8(FindRecord);
Heiko Rompel
Germany