|
|
|
Joined: Dec 2002
Posts: 2,884
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,884 |
While that may look more like other mIRC scripting statements that take a code block, I think the use of ":" is a more suitable syntax. The primary reason is to show that the code following each case does not behave the same as a code block, ie. each case is not self-contained, but rather they cascade into one another. Just to make it clear to anyone who might not know how switch/case statements (should) behave: switch ($moo) {
case 1:
echo -a moo 1
case 2:
echo -a moo 2
break
case 3:
echo -a moo 3
} If $moo equals 1, that code would output the following: Once a switch statement finds a case that matches, it executes all case statements following that one aswell until it reaches a break. The use of ":" rather than braces is a better indicator of that I think. Presumably this is also why other programming languages use the same structure.
|
|
|
Entire Thread
|
Case: 1,2,3,4 etc...
|
Anonymous
|
22/02/08 08:25 AM
|
Re: Case: 1,2,3,4 etc...
|
The_JD
|
22/02/08 08:52 AM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
22/02/08 09:42 AM
|
Re: Case: 1,2,3,4 etc...
|
genius_at_work
|
22/02/08 02:56 PM
|
Re: Case: 1,2,3,4 etc...
|
The_JD
|
22/02/08 04:35 PM
|
Re: Case: 1,2,3,4 etc...
|
RoCk
|
22/02/08 04:43 PM
|
Re: Case: 1,2,3,4 etc...
|
starbucks_mafia
|
22/02/08 04:58 PM
|
Re: Case: 1,2,3,4 etc...
|
hixxy
|
23/02/08 08:53 PM
|
Re: Case: 1,2,3,4 etc...
|
starbucks_mafia
|
23/02/08 10:16 PM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
23/02/08 11:21 PM
|
Re: Case: 1,2,3,4 etc...
|
hixxy
|
24/02/08 01:08 AM
|
Re: Case: 1,2,3,4 etc...
|
Mpdreamz
|
26/02/08 07:43 PM
|
Re: Case: 1,2,3,4 etc...
|
argv0
|
26/02/08 11:42 PM
|
Re: Case: 1,2,3,4 etc...
|
Mpdreamz
|
28/02/08 12:00 PM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
26/02/08 11:44 PM
|
Re: Case: 1,2,3,4 etc...
|
argv0
|
27/02/08 09:53 AM
|
Re: Case: 1,2,3,4 etc...
|
Bekar
|
27/02/08 11:42 AM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
29/02/08 08:34 PM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
22/02/08 05:00 PM
|
Re: Case: 1,2,3,4 etc...
|
The_JD
|
22/02/08 05:03 PM
|
Re: Case: 1,2,3,4 etc...
|
jaytea
|
23/02/08 01:35 AM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
23/02/08 03:17 AM
|
Re: Case: 1,2,3,4 etc...
|
Mpdreamz
|
23/02/08 12:28 PM
|
Re: Case: 1,2,3,4 etc...
|
BhaaL
|
23/03/08 12:37 PM
|
Re: Case: 1,2,3,4 etc...
|
Riamus2
|
23/03/08 10:26 PM
|
Re: Case: 1,2,3,4 etc...
|
argv0
|
23/03/08 10:33 PM
|
Re: Case: 1,2,3,4 etc...
|
Riamus2
|
24/03/08 10:48 PM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
23/02/08 04:36 PM
|
Re: Case: 1,2,3,4 etc...
|
The_JD
|
23/02/08 05:42 PM
|
Re: Case: 1,2,3,4 etc...
|
Anonymous
|
24/04/08 08:18 PM
|
Re: Case: 1,2,3,4 etc...
|
argv0
|
24/04/08 10:44 PM
|
|
|
|
|
|
|