ifthen1.gms : Test $ifthen and $endif


Contributor: Alex

Small Model of Type : GAMS

Category : GAMS Test library

Main file : ifthen1.gms

$title 'Test $ifthen and $endif' (IFTHEN1,SEQ=364)

Contributor: Alex

scalar count / 0 /;
$ifthene 0
$abort need to crash
display 'good ifthen 1'; count = count+1;

$ifthene 1
display 'good ifthen 2'; count = count+10;
$log ok here
$abort really bad

$ifthene 0
$abort should be skipped
$endif  $log first $endif

scalar qnumber / 3 /
$ifthene.bad qnumber=0 abort "skip same line";
abort "second skip";
abort 'should be skipped';
$endif.bad log garbage
display 'more';count = count+100;

abort$(count<>111) 'something went wrong count should be 111',count;