Imo it would be nice to be able to use wildcards in the $com identifier to enumerate all the open comobjects matching the wildcarded name.

$com(excel_*) would return the name of the connection named "excel_*" so that you could still use the literal asterisk * and question mark ? as part of the com name, but the newly added feature would be like this: $com(excel_*,<N>) which would make the asterisk a wildcard instead.

Right now I use the common technique of opening com objects based on a var with $ticks, though I think it would be nice if you could just add a statement like this at the end of your snippet:

while $com(excel_*,1) { .comclose $v1 }

Another option could be to add a "w" flag to comclose, which allows you to use wildcards, and would go like this: /comclose -w excel_*

If this is out of the question, perhaps a way to kill all com objects that were created within the scope of the running script, like "/comclose -l" where the l stands for "local".

Or perhaps add a switch to comopen which would act like set -l, as in it creates a com object that only lasts for the duration of the script. Something like /comopen -l excel_app excel.application perhaps. Any object that is created through dispatch, coming from a local object, would then also be local.

This would be especially nice, if it would work in the same way as local vars vs global vars work.
Meaning if you have an already open global comobject named "excel", but you create a local object with -l switch in an alias, mIRC will distinguish the local one from the global one, thus we don't have to worry anymore that there might already be an object with that name open, since it's "local".

I suppose you could summarize my request to: make $com(name) more similar to $var where you can specify local or global and enumerate based on wildcards, and make /comopen more similar to /set where you can choose to use -l (which is the same as /var).

The suggested syntax and examples are only there to visualize the feature suggestion.

Last edited by FiberOPtics; 06/02/05 09:24 AM.

Gone.