hash table problem - 15/11/08 11:23 PM
What am i missing here? the hash table have the words stored in it, i can list them to a dialog, but when i trying to remove or add a word it don't notice the word is in the list. nether on add or remove, it add the word over and over again, and when i trying to remove it, then i get that the word don't exist, so what am i missing here? the %var store the word i want to remove, tested to write in the word in the code, still no luck with it. loadbadword loads the words to the dialog, and as i wrote before it show all the words as it show, so nothing wrong there. and i can echo the words to me:
moo
blaa
test
and i trying to remove "moo", nothing, and i tested all the word's with the same result..
moo
blaa
test
and i trying to remove "moo", nothing, and i tested all the word's with the same result..
Code:
on *:start:{ if (!$hget(badword)) { hmake badword } if ($exists(badword.hsh)) { hload badword badword.hsh } } alias add.bword { if ($hget(badword,%badword)) { dialog -t badword The badword $+($chr(34),%badword,$chr(34)) already exists in the list. } if (!$hget(badword,%badword)) { hadd badword %badword | dialog -t badword The badword $+($chr(34),%badword,$chr(34)) added succesfully. | loadbadword } } alias del.bword { if (!$hget(badword,%rbadword)) { dialog -t badword The badword $+($chr(34),%rbadword,$chr(34)) does not exist in the list. } if ($hget(badword,%rbadword)) { hdel badword %rbadword | dialog -t badword Badword $+($chr(34),%rbadword,$chr(34)) removed succesfully. | loadbadword } }