Description
GAMS Release 23.7 introduced the keyword FUNCTION(S) This mode ensures that older models/restart files which contain function(s) as an identifier still work. Contributor: L. Westermann
Small Model of Type : GAMS
Category : GAMS Test library
Main file : funcback.gms
$title Test function backward compatibility (FUNCBACK,SEQ=514)
$onText
GAMS Release 23.7 introduced the keyword FUNCTION(S)
This mode ensures that older models/restart files which contain function(s) as
an identifier still work.
Contributor: L. Westermann
$offText
* Function can be used as identifier
$onEcho > f.gms
scalar function /1/;
$offEcho
$call gams f.gms lo=%GAMS.lo%
$if errorlevel 1 $abort '*** f1 failed'
* Function can not be used as identifier after being used as keyword
$onEcho > f.gms
$funcLibIn sto stodclib
function SetSeed /sto.SetSeed/;
scalar function /1/;
$offEcho
$call gams f.gms lo=%GAMS.lo%
$if not errorlevel 1 $abort '*** f2 failed'
* Function can not be used as keyword after being used as identifier
$onEcho > f.gms
$funcLibIn sto stodclib
scalar function /1/;
function SetSeed /sto.SetSeed/;
$offEcho
$call gams f.gms lo=%GAMS.lo%
$if not errorlevel 1 $abort '*** f3 failed'
* Function can not be as identifier in restart file
$onEcho > f.gms
scalar function /1/;
$offEcho
$call gams f.gms lo=%GAMS.lo% s=0
$onEcho > f.gms
display function;
$offEcho
$call gams f.gms lo=%GAMS.lo% r=0
$if errorlevel 1 $abort '*** f4 failed'
* Function can not be used as keyword after being used as identifier in restart
* file
$onEcho > f.gms
scalar function /1/;
$offEcho
$call gams f.gms lo=%GAMS.lo% s=0
$onEcho > f.gms
$funcLibIn sto stodclib
function SetSeed /sto.SetSeed/;
$offEcho
$call gams f.gms lo=%GAMS.lo% r=0
$if not errorlevel 1 $abort '*** f5 failed'