mIRC Home    About    Download    Register    News    Help

Print Thread
#8792 29/01/03 07:25 PM
Joined: Dec 2002
Posts: 29
N
Nem3sis Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 29
WHY cant you have nested while loops on the one line?.... i.e.

//var %i = 1 | while (%i < 4) { echo -at rar %i | var %i2 = 1 | while (%i2 < 4) { echo -at m00 %i2 | inc %i2 } | inc %i }

gives

(07:24:18p) rar 1
(07:24:18p) m00 1
(07:24:18p) m00 2
(07:24:18p) m00 3

just as

//var %i 1 | while (%i < 22) { echo -at rar %i | while (%i < 4) { echo -at m00 %i | inc %i } | inc %i }

gives only

(07:24:57p) rar 1
(07:24:57p) m00 1
(07:24:57p) m00 2
(07:24:57p) m00 3

they both forget the first loop

#8793 29/01/03 10:38 PM
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
alias whileloop {
__var %i = 1 , %ii = 1
__while (%i <= 10) {
____echo -a loop1: %i
____while (%ii <= 10) {
______echo -a loop2: %ii
______inc %ii
____}
____echo -a loop2: end
____inc %i
__}
__echo -a loop1: end
}

works like a charm... you can't use the %i twice, you need to use another var

(don't mind the _, just for looks)


If it ain't broken, don't fix it!
#8794 29/01/03 11:08 PM
Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
Use the code tags if you want spaces in, like:

Code:
alias whileloop {
  var %i = 1 , %ii = 1
  while (%i &lt;= 10) {
    echo -a loop1: %i
    while (%ii &lt;= 10) {
      echo -a loop2: %ii
      inc %ii
    }
    echo -a loop2: end
    inc %i
  }
  echo -a loop1: end
}


smile

#8795 30/01/03 02:54 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
You're right. happened to me too. unless khlaed is going to fix this to the next version, you'd have to break it to a few lines.

#8796 30/01/03 08:44 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Yeah this bug haunts mirc for quite a few versions. Let's hope it's fixed in the next one (together with $base :tongue:)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard