|
$If and $Ifi |
Top Previous Next |
|
The $If statement causes execution of a GAMS statement when a conditional is true. The basic form of the $If and $Ifi command is
$If conditional statementtoexecute $Ifi conditional statementtoexecute
or with the instruction on the next line
$If conditional statementtoexecute or $Ifi conditional statementtoexecute
The net effect is that the code that GAMS will execute will either contain or not contain statementtoexecute depending on the true false nature of the conditional. In particular, when the conditional in the $If or $Ifi test is true, then the statementtoexecute will be entered into the source code to be executed. If not, then the statements statementtoexecute will never be executed. Notes:
|