Page 2 of 2

Posted: 17 Oct 2011 8:43
by Steve Lympany

Re:

Posted: 19 Oct 2011 8:11
by danepa
Tonton Luc wrote:Hi,
Try this :

Code: Select all

login(Nama,Password) :-     user(Nama, _, _, _, _, Password),     S=string::format("Welcome '%' ",Nama),     vpicommondialogs::note(S),     !. login(Nama,_) :-     S=string::format("sorry but you're not welcome '%'\n...because your name is not in personDB.txt.",Nama),     vpicommondialogs::error(S).
It's not work, it always not found in database.

Posted: 19 Oct 2011 12:09
by Paul Cerkez
couple of quick questions (sometimes the obvious escapes us :oops: ):

1. is the user fact base loaded into memory yet?
2. is the NAMA and PASSWORD variable bound with exactly the values that are stored inthe user fact base?

an extra space or even a different capitalization of letters will cause the search to fail. As your code is written, it requires an exact match of both the NAMA and PASSWORD (to include the character sets used)