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

  1. Program Example50;
  2.  
  3. { Program to demonstrate the Read(Ln) function. }
  4.  
  5. Var S : String;
  6.     C : Char;
  7.     F : File of char;
  8.     
  9. begin
  10.   Assign (F,'ex50.pp');
  11.   Reset (F);
  12.   C:='A';
  13.   Writeln ('The characters before the first space in ex50.pp are : ');
  14.   While not Eof(f) and (C<>' ') do
  15.     Begin
  16.     Read (F,C);
  17.     Write (C);
  18.     end;
  19.  Writeln;   
  20.  Close (F);
  21.  Writeln ('Type some words. An empty line ends the program.');
  22.  repeat 
  23.    Readln (S);
  24.  until S='';  
  25. end.
  26.