mIRC Home    About    Download    Register    News    Help

Print Thread
while | else #265722 08/07/19 04:59 AM
Joined: Feb 2003
Posts: 2,650
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,650
Could you add elseif / else support to supplement while condition fails? This would enable a solution to doing a task if no while loop had been performed.

Code
while ($0) {
  do something with $1
  tokenize 32 $2-
}
else {
  tokenize 32 foobar
}


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: while | else [Re: Raccoon] #265723 08/07/19 11:49 AM
Joined: Jul 2006
Posts: 3,568
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,568
I do this quite often, I just set a variable inside the loop and check if it's set after.

Are there others languages supporting an else on a while statement like that?

As weird as it looks, i'm all for it!

Last edited by Wims; 08/07/19 11:50 AM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net