mIRC Home    About    Download    Register    News    Help

Print Thread
While loop continue function #189174 04/11/07 07:21 PM
Joined: Oct 2007
Posts: 51
T
Trashlord_ Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2007
Posts: 51
Code:
alias mdeop {
var %i = $nick($chan,0)
while (%i) {
if ($nick($chan,%i) == $me) { continue }
var %t = %t $nick($chan,%i)
<rest is not important>
dec %i
}
}


The continue function used in this type of loop, freezes mIRC, I have to press ctrl + break to kill the loop and regain control.

I use 6.31, Windows XP Service Pack 2.

Re: While loop continue function [Re: Trashlord_] #189179 04/11/07 07:29 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
That should be expected if you consider what the continue command does. As soon as $nick($chan,%i) evaluates to your nick, the code jumps directly back to the top of the loop and the line 'dec %i' is never executed from that point on. Wash, rinse, repeat.

Re: While loop continue function [Re: schaefer31] #189181 04/11/07 07:34 PM
Joined: Oct 2007
Posts: 51
T
Trashlord_ Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2007
Posts: 51
Right, tested it, not a bug, thanks for the info.