mIRC Home    About    Download    Register    News    Help

Print Thread
#59882 11/11/03 08:23 PM
Joined: Nov 2003
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Nov 2003
Posts: 4
switch(var) {
case 1:

case 2:

default :

}
very useful! :tongue:


/*** Only evils lives here crazy ***/
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
In the meantime you can use /goto as a wordaround. See this and this threads.

Joined: Nov 2003
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Nov 2003
Posts: 4
but goto is not a structured programmation


/*** Only evils lives here crazy ***/
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
So? Does it solve your problem equally well without creating spaghetti code or otherwise making your life difficult now or in the future? If the answer is yes, who cares what is "structured programming" and what isn't? I would perhaps prefer a true switch instead of a goto here for a couple of reasons; goto not being structured programming certainly isn't one of them though.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Nov 2003
Posts: 35
R
Ameglian cow
Offline
Ameglian cow
R
Joined: Nov 2003
Posts: 35
mIRC is not meant to be a high level programming language like C++. If it was, we would have many more commands to work with. There are tons of useful C++ commands that would be helpful in various scripts. However, that's not the purpose of mIRC. As long as there are commands to accomplish what needs done, that is enough, imo. smile

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I thought that also, but just becuse you can "alreayd do it" doens't mean there isn't a better way or shouldn't be a better way. For exaple, C++ (for the most part) is C with a lot of shortcuts, and cut corners. Such as why did C++ feel the need to add cout, when printf already existed? You can print everything you want with printf, So why add cout?

It's little things that are nice in the longrun that make thigns enjoyable. Even if it can be done otherwise, the shortcuts are nice >:D


-KingTomato
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
mIRC scripting isn't intended to be structured or object oriented.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
I think you'll find it's intended to be structured, otherwise we'd all be using goto statements instead of while loops and defined aliases.

Personally I don't really mind either way if it's added or not, but I don't think anyone can honestly claim that adding switch statements would be contrary to the ideals of mIRC's scripting language.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard