mIRC Homepage
Posted By: onesikgypo real quick n easy question - hash tables - 27/01/06 05:39 AM
if i wanted to do something similar to

if ($read(file.txt, s,text)) { commands }

with a hash table how would i do it, im not the best with them i tried

if ($hget(TableName,Text)) with no luck
/help $hfind

you should take a minute to read the hash table section of the help file
yes i did see that, and i had tried a

/timer 1 1 if ($hfind(123456,#bla)) { echo -a A } | else { echo -a B }

and it returns B...and i know it says N'th item, but i need it to search the whole thing so i tried with ,0 as well with no luck

and yes i had done a hmake 123456 10 then hadd 123456 #bla #bla
it returns the Nth match it does search the whole thing
what it returns is the item name of whatever number match you request
then i dont see why it wouldnt be echoing A instead of B

like i said basically i wanted to make sure the #channel was in the hash table before continuing
Post deleted by NeUtRoN_StaR
still echoing B, and i didnt want to use a wildmatch because maybe the channel #bla is in their but not #bla-2 but it should be exact like i said i had done a /hadd 123456 #bla #bla
Posted By: RusselB Re: real quick n easy question - hash tables - 27/01/06 06:26 AM
Try this
/timer 1 1 echo -a $iif($hfind(123456,#bla,1).data,A,B)
if it is the way you say it is then
$hfind(table,text,N).data should work just fine
as long as text matches the data entry exactly

further if you made the item and data the same then it should work without the .data suffix
that will work for him
and its prettier
the funny bit is he had it like 3 posts ago he just refused to specify N for some reason

© mIRC Discussion Forums