mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-29 23:31:46 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			486 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			486 B
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
| Program Example33;
 | |
| 
 | |
| { Program to demonstrate the SelectText function. }
 | |
| 
 | |
| Uses linux;
 | |
| 
 | |
| Var tv : TimeVal;
 | |
|     
 | |
| begin
 | |
|   Writeln ('Press the <ENTER> to continue the program.');
 | |
|   { Wait until File descriptor 0 (=Input) changes }
 | |
|   SelectText (Input,nil);
 | |
|   { Get rid of <ENTER> in buffer }
 | |
|   readln;
 | |
|   Writeln ('Press <ENTER> key in less than 2 seconds...');
 | |
|   tv.sec:=2;
 | |
|   tv.usec:=0;
 | |
|   if SelectText (Input,@tv)>0 then 
 | |
|     Writeln ('Thank you !')
 | |
|   else
 | |
|     Writeln ('Too late !');
 | |
| end.
 | 
