The last break on default is considered by some to be a coding standard, by which you explicitly say you wanted to leave the default block empty, and not just simply forgot. Also, if unadvised people add code at the end of the switch without realizing the missing break, your default will fall-through.
On 12/21/06, T. Michael Keesey <[EMAIL PROTECTED]> wrote:
On 12/21/06, Julien Vignali <[EMAIL PROTECTED]> wrote: > > switch(condition){ > case A: > break; > case B: > break; > default: > // not mendatory but should always be the last statement > break; > } That last break is actually unnecessary. The breaks are only to keep it from going to the next case. In some (pretty rare) cases, you may not even want to do that, e.g.: switch(a) { case 0: // Does this if a == 0 break; case 1 : // Does this if a == 1. case 2 : // Does this if a == 1 or a == 2. default : // Does this if a is anything but 0. } -- T. Michael Keesey The Dinosauricon: http://dino.lm.com Parry & Carney: http://parryandcarney.com ISPN Forum: http://www.phylonames.org/forum/ _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com