ifthen1.gms : Test $ifThen and $endIf

Description

Contributor: Alex


Small Model of Type : GAMS


Category : GAMS Test library


Main file : ifthen1.gms

$title 'Test $ifThen and $endIf' (IFTHEN1,SEQ=364)

$onText
Contributor: Alex
$offText

scalar count / 0 /;
$onDollar
$ifThenE 0
$abort need to crash
$else
display 'good ifthen 1'; count = count+1;
$endIf

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

$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;