mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 17
KyD Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 17
with two nested while loops, after at least one iteration through both loops, calling /continue in the outer while loop somewhere before the inner loop, will cause the script to continue right before the inner while loop instead of right before the outer one. the following alias illustrates this:
Code:
alias tw {
  var %a = 2
  while ($true) {
    if (%a == 1) {
      %a = 0
      continue
    }
    %a = 2
    while (%a == 2) {
      %a = 1
    }
    if (%a == 0) {
      return
    }
  }
}

this alias does not terminate in mirc <=6.14 but in mirc 6.15 it returns after the second iteration.
tested under winxp.

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Confirmed here:
Code:
alias tw2 {
  var %i = 5
  while (%i) {
    dec %i
    echo -s w1 ( %i )
    if (%i == 2) {
      echo -s continue
      continue
    }
    while (%i &gt; 3) {
      dec %i
      echo -s w2 ( %i )
    }
    echo -s end w1
  }
}

returns:
w1 ( 4 )
w2 ( 3 )
end w1
w1 ( 2 )
continue
end w1
w1 ( 1 )
end w1
w1 ( 0 )
end w1

The red line should not be there...

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
And my results are (6.15 & 2kpro sp3):

w1 ( 4 )
w2 ( 3 )
end w1
w1 ( 2 )
continue
end w1
w1 ( 1 )
end w1
w1 ( 0 )
end w1


Those who fail history are doomed to repeat it
Joined: Feb 2003
Posts: 1
D
Mostly harmless
Offline
Mostly harmless
D
Joined: Feb 2003
Posts: 1
Clearly a bug in 6.15. Tested both, firstly 6.14...

w1 ( 4 )
w2 ( 3 )
end w1
w1 ( 2 )
continue
w1 ( 1 )
end w1
w1 ( 0 )
end w1

Then 6.15....

w1 ( 4 )
w2 ( 3 )
end w1
w1 ( 2 )
continue
end w1
w1 ( 1 )
end w1
w1 ( 0 )
end w1

There appears the end w1 in the middle.

Dan

Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
Thanks this has been fixed for the next version.

Joined: Dec 2002
Posts: 329
Fjord artisan
Offline
Fjord artisan
Joined: Dec 2002
Posts: 329
The problem discussed in this tread, and a few related threads) has been fixed in the new mIRC 6.16.
(5.Fixed while/continue/break bugs.)


Link Copied to Clipboard