home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 484 b | 23 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- domains
- file = myfile
-
- predicates
- readloop
-
- goal
- write("this program reads your input and writes it to TRYFILE.ONE\n"),
- openwrite(myfile, "tryfile.one"),
- writedevice(myfile),
- readloop,
- closefile(myfile),
- writedevice(screen),
- write("Your input has been transferred to the file tryfile.one").
-
- clauses
- readloop:-readchar(X), X<>'#',!, write(X), readloop.
- readloop.