unexpected end of file erro when read from external file
Posted: 18 Mar 2014 8:44
i try lots of example each has erro :unexpected end of file
Code: Select all
implement main
open core
class predicates
copyLine : (inputStream I, outputStream O).
clauses
copyLine(I, O) :-
Line = I:readLine(),
O:write(Line, "\n").
class predicates
onClick:() procedure.
clauses
onClick() :-
InputFile = inputStream_file::openFile("c:\\test.txt"),
OutputFile = outputStream_file::openFile("c:\\test2.txt"),
copyLine(InputFile, OutputFile),
copyLine(InputFile, OutputFile),
OutputFile:writef("a="), /* insert other data in between*/
std::repeat(),
copyLine(InputFile, OutputFile),
InputFile:endOfStream(),
!,
InputFile:close(),
OutputFile:close().
onClick() .
clauses
run():-
console::init(),
onClick(),
succeed(). % place your own code here
end implement main
goal
mainExe::run(main::run).