ex50.pp 469 B

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