home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex26.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  671 b   |  23 lines

  1. Program Example26;
  2.  
  3. { Program to demonstrate the Flush function. }
  4.  
  5. Var F : Text;
  6.  
  7. begin
  8.   { Assign F to standard output }
  9.   Assign (F,'');
  10.   Rewrite (F);
  11.   Writeln (F,'This line is written first, but appears later !');
  12.   { At this point the text is in the internal pascal buffer,
  13.     and not yet written to standard output }
  14.   Writeln ('This line appears first, but is written later !');
  15.   { A writeln to 'output' always causes a flush - so this text is 
  16.     written to screen }
  17.   Flush (f);
  18.   { At this point, the text written to F is written to screen. }
  19.   Write (F,'Finishing ');
  20.   Close (f);  { Closing a file always causes a flush first } 
  21.   Writeln ('off.');
  22. end.
  23.