Re: New switch/case idea

new topic     » goto parent     » topic index » view thread      » older message » newer message
jeremy said...
bernie said...

Matt:

The problem with your idea is that instead of having to type all those breaks now I would have to type all of the continues which does it make any easier.

Keep it simple, just let us turn fall through on or off.

Hey, Bernie! There are very limited uses of \\ in your message. Thank you!

The use of continue would be the exception For a switch that has fallthru turned on, you do not need continue. Here's an example:

X=1 
switch X with fallthru do 
    case 1: ? 1 
    case 2: ? 2 
    case 3: ? 3 
    case 4: ? 4 
    case 5: ? 5 break 
    case 6: ? 6 
    case 7: ? 7 
end switch 

This switch has fallthru turned on, therefore, if you want to stop processing, then you must type break. The above example would print 1, 2, 3, 4, 5.

<snip>

How?

If x = 1, as stated, the "case 1:" is triggered, but why is 2,3,4,5 triggered??

useless

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu