undf1.gms : $onUNDF/offUNDF changes the scanner

Description

first we test the default


Small Model of Type : GAMS


Category : GAMS Test library


Main file : undf1.gms

$title $onUNDF/offUNDF changes the scanner (UNDF1,SEQ=49)

* first we test the default
scalar undf now it is a scalar; undf = 10;
scalar bad  / undf /;
$if not errorfree $goTo skip
$error UNDF not allowd here
$exit

$label skip
$clearError

* now we make undf a reserved word
* and test at execution time
undf =
$onUNDF
undf;
scalar good / undf /;
$offUNDF

scalar code; code = 0/0; execerror=0;
abort$(code <> undf) 'something wrong here'
abort$(code <> good)  'something wrong here'

display code,undf,bad,good;