home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l210 / 1.ddi / EXAMPLES.ARC / CH12EX09.PRO < prev    next >
Encoding:
Prolog Source  |  1988-06-21  |  545 b   |  26 lines

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