home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / Turbo Prolog 2 / EXAMPL45.PRO < prev    next >
Encoding:
Prolog Source  |  1986-04-25  |  574 b   |  24 lines

  1.                 /* Program 45 */
  2. domains
  3.     file = input
  4. predicates
  5.     start
  6.     print_contents
  7.     
  8. goal start.
  9.     
  10. clauses
  11.     start:-
  12.         clearwindow,
  13.         write("Which file do you want to work with ?"),
  14.         readln(FileName),
  15.         openread(input,FileName),
  16.         readdevice(input),
  17.         print_contents.
  18.     print_contents:-
  19.         not(eof(input)),readchar(Y),char_int(Y,T),
  20.         write(T," "),print_contents.
  21.     print_contents:-
  22.         nl,readdevice(keyboard),
  23.         write("\nPlease press the space bar"),readchar(_).
  24.