CASE: Difference between revisions
Jump to navigation
Jump to search
Created page with '{{missing}} Category:Syntax' |
No edit summary |
||
| Line 1: | Line 1: | ||
The ''CASE'' statement is used within [[WHEN]], [[SWITCH]] and [[SELECT]] blocks. These all handle modeling alternatives within a single definition. The easy way to remember the difference is that | |||
* [[WHEN]] picks which equations to solve '''when''' discrete variables have certain values | |||
* [[SELECT]] '''selects''' which statements to compile based on discrete constants. | |||
* [[SWITCH]] statements handle flow of control in methods, in a slightly more generalized form than the C language switch statement. | |||
See also [[conditional modelling]]. | |||
[[Category:Syntax]] | [[Category:Syntax]] | ||
Revision as of 08:10, 15 August 2010
The CASE statement is used within WHEN, SWITCH and SELECT blocks. These all handle modeling alternatives within a single definition. The easy way to remember the difference is that
- WHEN picks which equations to solve when discrete variables have certain values
- SELECT selects which statements to compile based on discrete constants.
- SWITCH statements handle flow of control in methods, in a slightly more generalized form than the C language switch statement.
See also conditional modelling.