Code: Select all
addterm(Filename):-
mydb := chainDB::db_open("c:\\mydatabase2.db",chainDB::in_file),
mydb:bt_open("booktree",Selector),
selector:=Selector,
InputFilestream = inputStream_file::openFile8(Filename),
repeat(),
String=InputFilestream:readline(),
hasdomain(term,Term),
console::write("addterm"),
conversion5x::term_str(Term,String),
mydb:chain_inserta(Filename,Term,Ref),
Term=tm(_Fname,_Path,Kwords,_Topic),
mydb:key_insert(selector,Kwords,Ref),
console::write(Term),
inputStream::endOfStream,
InputFilestream:close(),
console::write("close db"),
mydb:db_close(),
mydb:bt_close(selector),
mydb := erroneous.