Re: New switch/case idea

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

Jeremy:

I want fall through to be the default or at least make easy to enable with a single command.

If you have a function and a large switch you can do things like the following which doesn't use break.

 
switch some_value do  
 
value1 case: 
return peek({addr,5}} 
value2 case: 
return peek({addr,32}} 
value3 case: 
return peek({addr,15}} 
value4 case: 
return peek({addr,50}} 
value5 case: 
do_my_procedure(value5, parm1) -- continues through the switch  
value6 case: 
return do_my_function(value6,parm1) 
-- ............. etc. 
end switch 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu