summaryrefslogtreecommitdiff
path: root/fpcdocs/unutilex/ex34.pp
blob: dfbe52c67055d08e7141d9c3760d37ed3a6681fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Program Example33;

{ Program to demonstrate the SelectText function. }

Uses Unix;

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.tv_sec:=2;
  tv.tv_sec:=0;
  if SelectText (Input,@tv)>0 then
    Writeln ('Thank you !')
  else
    Writeln ('Too late !');
end.