~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/linuxex/ex33.pp

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program Example33;
2
 
 
3
 
{ Program to demonstrate the Select function. }
4
 
 
5
 
Uses BaseUnix;
6
 
 
7
 
Var FDS : sigset_t;
8
 
 
9
 
begin
10
 
  fpsigemptyset (FDS);
11
 
  fpsigaddset (FDS,0);
12
 
  Writeln ('Press the <ENTER> to continue the program.');
13
 
  { Wait until File descriptor 0 (=Input) changes }
14
 
  fpSelect (1,@FDS,nil,nil,nil);
15
 
  { Get rid of <ENTER> in buffer }
16
 
  readln;
17
 
  Writeln ('Press <ENTER> key in less than 2 seconds...');
18
 
  fpsigemptyset (FDS);
19
 
  fpsigaddset (FDS,0);
20
 
  if fpSelect (1,@FDS,nil,nil,2000)>0 then 
21
 
    Writeln ('Thank you !')
22
 
    { FD_ISSET(0,FDS) would be true here. }
23
 
  else
24
 
    Writeln ('Too late !');
25
 
end.