home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / EXAMPLES / CH12EX09.PRO < prev    next >
Encoding:
Prolog Source  |  1990-03-26  |  484 b   |  23 lines

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4.    
  5. domains
  6.    file = myfile
  7.  
  8. predicates
  9.    readloop
  10.  
  11. goal
  12.    write("this program reads your input and writes it to TRYFILE.ONE\n"),
  13.    openwrite(myfile, "tryfile.one"),
  14.    writedevice(myfile),
  15.    readloop,
  16.    closefile(myfile),
  17.    writedevice(screen),
  18.    write("Your input has been transferred to the file tryfile.one").
  19.  
  20. clauses
  21.    readloop:-readchar(X), X<>'#',!, write(X), readloop.
  22.    readloop.
  23.