it would indeed be more efficient, and you could make the same case for identifiers such as $fline, $didwm / $didreg, $wildtok, etc.

Khaled has already given us this type of thing in identifiers such as $findfile (its command and window parameters) and $read (ability to start searching from a given line), but they involve much slower operations. this level of optimization is therefore less important with the identifiers mentioned above.

however, what might be nice to see is a more generalized solution to the problem of quickly iterating through these kind of collections. a 'for each' structure has been brought up several times in the past, which would be quite helpful in these situations. it would probably require numerous deep changes to mIRC's interpreter in order to be made efficiently, though.. ie. in a way that is different from our current iterative methods.

anyway.. if you expect the number of matches with your $hfind() to be quite high compared to the number of items in the table, you could try looping through items with $hget() and using iswm or $regex() to perform the tests. or save the table in a suitable format with /hsave and try handling it with /filter. play around and see if you can find something better :P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde