~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to docs/bunixex/ex33.pp

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

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 : Tfdset;
8
 
 
9
 
begin
10
 
  fpfd_zero(FDS);
11
 
  fpfd_set(0,FDS);
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
 
  Fpfd_zero(FDS);
19
 
  FpFd_set (0,FDS);
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.