Re: If statements vs case
Hershel Fisch <hershf@...
2007-03-01 01:33:33 GMT
On 2/28/07 7:45 PM, "Shao Sean" <shaosean@...> wrote:
Thanks a mill
>> Sorry, what do you mean that IF-ELSE-IF is always evaluated?
> If you have a 20 line nested IF-ELSE-IF statement and the one that
> matches your current situation is the 20th one, the previous 19 are
> evaluated (thankfully Rev uses some short-circuited methods to speed it
> In a SWITCH statement the engine/compiler converts the CASE statements
> into a hashed lookup table (think fast) and as such when the SWITCH
> statement is evaluated it just quickly looks up the code to run in the
> hash table.
> As I mentioned in my first posting, if you're only using the IF-ELSE-IF
> statement a few times, you don't have to wait for the SWITCH lookup
> table to be hashed (adding overhead the first time a SWITCH statement
> is called)
> Also mentioned in my first posting, how much of this applies to
> Revolution in general only they know, as Revolution allows you to some
> weird things with the SWITCH statements that you couldn't do in other
> languages (apparently a lot of languages the result of the SWITCH
> statement can only be an integer)