Best Practices in Rev development

Stephen Barncard stephenREVOLUTION at barncard.com
Thu Jun 21 14:02:00 EDT 2007


for me a great advantage of SWITCH is the opportunity for fast and 
easy multiple if statements done this way instead:

SWITCH pKey
CASE "B"
CASE return
CASE "P"
printThePage
default
doDefaultThing
END SWITCH

easy to read, easy to write.


>
>I haven't timed it - but if it's read by the engine in the same 
>manner other programming languages handle it then it would be faster 
>as any subsequent conditions are skipped because once the case 
>statement (switch statement) is met the compiler knows not to 
>proceed - as opposed to if/then/else etc where the entire handler is 
>evaluated in full.
>
>Scott Kane

-- 


stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -





More information about the use-livecode mailing list