mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 23:49:28 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			530 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			530 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example43;
 | |
| 
 | |
| { This program demonstrates the FindFirst function }
 | |
| 
 | |
| Uses SysUtils;
 | |
| 
 | |
| Var Info : TSearchRec;
 | |
|     Count : Longint;
 | |
| 
 | |
| Begin
 | |
|   Count:=0;
 | |
|   If FindFirst ('*',faAnyFile and faDirectory,Info)=0 then
 | |
|     begin
 | |
|     Repeat
 | |
|       Inc(Count);
 | |
|       With Info do
 | |
|         begin
 | |
|         If (Attr and faDirectory) = faDirectory then
 | |
|           Write('Dir : ');
 | |
|         Writeln (Name:40,Size:15);
 | |
|         end;
 | |
|     Until FindNext(info)<>0;
 | |
|     end;
 | |
|   FindClose(Info);
 | |
|   Writeln ('Finished search. Found ',Count,' matches');
 | |
| 
 | |
| End. | 
