mIRC Homepage
Posted By: Nightstorm safe to use $event in an alias ? - 31/05/09 01:12 AM
hi,
Is it safe to use $event in an alias ? - I have oether events in the script like an Input event & text event to respond to channel triggers. - So I was wondering if its possible that like an input event would change the $event identifier whose original value was 'text' by the time the alias evaluated it.

Thanks!
Posted By: RusselB Re: safe to use $event in an alias ? - 31/05/09 01:21 AM
It would depend on how the identifier was being used in the alias.
Thinking quickly, if you're worried about the identifier changing value before the alias finished executing, there's little to no chance of that happening due to mIRC's single thread processing.
Of course, if you're really worried about it, you could pass the value of the $event identifier as a parameter to the alias.
Posted By: Nightstorm Re: safe to use $event in an alias ? - 31/05/09 02:28 AM
RusselB wrote. .
Quote:
It would depend on how the identifier was being used in the alias.
its being used in an if statement & the value am expecting is from the original event , say in this case a text event

RusselB wrote. . .
Quote:
Thinking quickly, if you're worried about the identifier changing value before the alias finished executing, there's little to no chance of that happening due to mIRC's single thread processing.


Like say am typing stuff in one window..(events may be captured in this window like an 'Input' event) - at the same time events(text for e.g)are being captured at the same time in the background in other open channel windows.

Thanks for the feedback.
-
Posted By: genius_at_work Re: safe to use $event in an alias ? - 31/05/09 03:33 AM
The value of $event will be valid/set until the event (including all called aliases) are finished executing. It may seem like several events can occur at once, but they are actually dealt with one at a time by mIRC, so the value of $event will not change within a single event.

-genius_at_work
Posted By: Nightstorm Re: safe to use $event in an alias ? - 31/05/09 04:51 AM
Thankyou for clearing that up ! ! !
© mIRC Discussion Forums