mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 08:31:49 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			359 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			359 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example51;
 | |
| 
 | |
| { Program to demonstrate the Reset function. }
 | |
| 
 | |
| Function FileExists (Name : String) : boolean;
 | |
| 
 | |
| Var F : File;
 | |
| 
 | |
| begin
 | |
|   {$i-}
 | |
|   Assign (F,Name);
 | |
|   Reset (F);
 | |
|   {$I+}
 | |
|   FileExists:=(IoResult=0) and (Name<>'');
 | |
|   Close (f);
 | |
| end;
 | |
| 
 | |
| begin
 | |
|   If FileExists (Paramstr(1)) then
 | |
|     Writeln ('File found')
 | |
|   else
 | |
|     Writeln ('File NOT found');
 | |
| end.
 | 
