problem with hfind - 26/12/05 04:56 AM
Hi! I'm trying to get an $hfind to work. What I'm doing is filtering a list of names into a window called @BOT.filter and then using hfind in an alias to pick each name, find it in a hash table and aline back to the window the name plus the result of the hfind (if any). Unfortunately it is going through the list of nicks and only returning the last entry.
Here's the code:
It starts out with two lines of about 50 names each like:
nick1, nick2, nick3, nick4...
nick59, nick60, nick61, nick62...
and it's taking them like it's supposed to one by one and spitting them out like:
nick1 hfind-result
nick2
nick3
nick4
.....
nick59 hfind-result
nick60
nick61
nick62
(the window sorts them)
problem is that nick62 and some of the others do have an hfind result but it's not being added (just the last name it gets to)
Any Help would be appreciated.
FTLNewsFeed
Here's the code:
Code:
alias pre.bot.filter { var %pbf.numberoflines = $line(@BOT.filter,0) var %c = 1 while (%pbf.numberoflines >= %c) { var %pbf.line = $line(@BOT.filter,%pbf.numberoflines) dline @BOT.filter %pbf.numberoflines var %pbf.numtok = $numtok(%pbf.line,44) while (%pbf.numtok >= %c) { var %pbf.name = $gettok(%pbf.line,%pbf.numtok,44) var %pbf.hfind = $hfind(hashtable,* $+ %pbf.name $+ *,1,w) aline @BOT.filter %pbf.name %pbf.hfind dec %pbf.numtok } dec %pbf.numberoflines } }
It starts out with two lines of about 50 names each like:
nick1, nick2, nick3, nick4...
nick59, nick60, nick61, nick62...
and it's taking them like it's supposed to one by one and spitting them out like:
nick1 hfind-result
nick2
nick3
nick4
.....
nick59 hfind-result
nick60
nick61
nick62
(the window sorts them)
problem is that nick62 and some of the others do have an hfind result but it's not being added (just the last name it gets to)
Any Help would be appreciated.
FTLNewsFeed