You seem to be lacking error checking: you are assuming that %b is always set, that is, every match in the iptracker table will have a corresponding match in the %hash table. Apparently that's not the case, so you should check whether %b is $null before you use it further.

Apart from that, there's something that doesn't look quite right:

set %c $hget(%hash,%a).data

What this does is retrieve the value of the %a-th item in %hash. Since hash tables are not ordered in any meaningful way, and that order changes as you add items, you most probaby do NOT want to access a hash table in that way. What you seem to need is the value of the item in %b. That's just

set %c $hget(%hash,%b)

I'd suggest you experiment with hash tables before trying to use them in "production": start out with simple example tables and test what each hash table-related identifier returns for various parameters you pass it, in order to get a good grasp on their function.



/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com