you are right C would be much faster than scripting but even using asm in large data lookups can be noticeable. As a somewhat small test try this create the hashtable fill it with 50 or items name My_dialog_control_id_name_1 etc... then perform a lookup for the last item do this in a while loop 20-50 cycles. C of course will be faster than this but not by much.

Now you have to remember not everyone writes clean code. And again this lookup would have to be performed for _every_ /did $did on *:dialog: for example if you used $did on an editbox to get its text then /did to set it to something else mirc would fire the edit dialog event. thats 3 lookups. now imagine multiple controls names on a command such as

/did my_id_1,my_id_2, yadday yadda ...

this has 4 lookups right off the bat 2 for the command and 2 for the event. imagine this in a loop.

or worste still imagine an event wich makes calls and alters other controls first you perform a lookup on control_1 fire the event for control_1 yet another lookup this event alters controls_2 another lookup and of course it must fire an event yet one more lookup.

the reason you cant simply cache the id's is because events and commands work in different areas. when you /did -r on an edit box mirc simply uses SetWindowText(editWnd,""); of course the edit window calls the WndProc of its parent window letting it know its text has changed. at this stage mirc would fire its event (the edit dialog event) but it is not aware of the fact that you just /did -r 'ed a control so yet another lookup.

There are a few ways you can work around the speed issue im working on a few for a TI project im writing. However its a bit of development for something that seems a bit small to me. I think khaleds time would be better spent on other aspects. (not that i dont like this idea)