Quote:
> exists, can be accessed for reading and contains a valid
> Prolog term terminated by a fullstop and blank character.
that was the Problem thanks :)
Now i have another Problem...
Given the following Code:
test:-readline('bla.txt',3,X),write(X),nl.
readline(File,Linenumber,Result):-see(File),readtheline(Linenumber,Resul
t,0),seen.
readtheline(Linenumber,Result,Linenumber):-!.
readtheline(Linenumber,Result,Current):-Y is Current + 1,write('2 '),
read(X), readtheline(Linenumber,X,Y).
the Procedure readtheline/3 works fine, a part of the fact, that at the
end, while exiting the recursion it resets the Var "Result".
Call: (11) readtheline(3, testline3, 3) ? creep
Exit: (11) readtheline(3, testline3, 3) ? creep
Exit: (10) readtheline(3, testline2, 2) ? creep
Exit: (9) readtheline(3, testline1, 1) ? creep
Exit: (8) readtheline(3, _G336, 0) ? creep
^^^^^^
bla.txt looks like this:
testline1.
testline2.
testline3.
...
Any hints how i can avoid this ?
Christoph