t94_textread.pas 617 B

12345678910111213141516171819202122232425262728293031323334
  1. program t94_textread;
  2. { t94 -- text-file Eof and Readln. CALC.INC's GetPages does
  3. while not Eof(H) do
  4. Readln(H, Buffer^[count]);
  5. and then reads back string elements from the pointer. Compile-only: the
  6. boot harnesses have no filesystem, so a successful text read has no oracle
  7. here. }
  8. type
  9. Pages = array [0..2] of string[5];
  10. var
  11. H : text;
  12. P : ^Pages;
  13. C : integer;
  14. S : string[5];
  15. begin
  16. New (P);
  17. assign (H, 'T94.TXT');
  18. reset (H);
  19. C := 0;
  20. while not Eof (H) do
  21. begin
  22. Readln (H, P^[C]);
  23. C := C + 1
  24. end;
  25. close (H);
  26. S := P^[0];
  27. writeln (S);
  28. Dispose (P)
  29. end.