- Код: Выделить всё
- function TLocator.Locate( Path : String ) : Boolean;
 var
 Info : TSearchRec;
 i : Integer;
 begin
 i := 0;
 if ( FindFirst( Path + '*', faAnyFile AND faDirectory, Info ) = 0 ) then
 repeat
 if Info.Name = '.' then
 continue;
 List[i].name := Info.Name;
 List[i].fullpath := Path + Info.Name;
 if ( Info.Attr AND faDirectory ) = faDirectory then
 begin
 List[i].directory := true;
 List[i].fullpath := List[i].fullpath + '/';
 end;
 i := i + 1;
 until ( FindNext( Info ) <> 0 );
 FindClose( Info );
 if i = 0 then
 Locate := false
 else
 begin
 Root := Path;
 Count := i - 1;
 Locate := true;
 end;
 end;
При первом вызове отрабатывает, при втором валится на FindNext, вне зависимости от директории.
Не могу понять в чем дело. Может быть кто подскажет. Спасибо.
An unhandled exception occurred at $0805A086 :
EAccessViolation : Access violation
$0805A086
$0804A24F
$08072670
$08060ECF
$08060B13
$08048BAB
$08048C4D
fpc 2.2.0

