----- Original Message ----- From: "J. Landman Gay" <[EMAIL PROTECTED]>

It's more of a feature of "switch" statements. That's just how they work, in any programming language.

Not quite. It may well be a feature of some - but not in general. Take an Object Pascal example (Borland Delphi):

procedure TMyButton.OnClick(Sender: TObject);
begin
   case MyNumber of
    0 : DoThisFunction;
    1 : DoThatFunction;
    2 : DoTheOtherFunction
    3: DoSomethingCompletelyDifferent;
  end;  //case
end;

Each element of the case statement is only evaluated of it is matches (in this instance) the value of MyNumber. Everything else is skipped. You have no break or exit statement as it's not needed and you could tack on an "else" statement to handle the unexpected if desired. Then of course there is short circuit boolean evaluation which speeds everything up including if statements by allowing only part of a statement to be read:

if not myBoolean = true then
DoSomething

If myBoolean is not false then everything is ignored as the compiler only sees it if it is in fact not true - and so on.....

Scott
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to