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

  1. /*
  2.    Copyright (c) 1986, 90 by Prolog Development Center
  3. */
  4.    
  5. domains
  6.    file = input
  7.  
  8. predicates
  9.    inspect_positions
  10.  
  11. goal
  12.    write("Which file do you want to work with ?"),
  13.    readln(FileName),
  14.    openread(input, FileName),
  15.    inspect_positions.
  16.  
  17. clauses
  18.    inspect_positions :-
  19.       readdevice(keyboard),
  20.       nl, write("Position No? "),
  21.       readreal(X),
  22.       readdevice(input), filepos(input, X, 0),
  23.       readchar(Y), write("Char is: ",Y),
  24.       inspect_positions.
  25.