Ondotl/Offdotl

Top  Previous  Next

Activates or deactivates the automatic addition of .L to variables on the right hand side of calculations as explained below. The syntax is

 

$OndotL

or

$OffdotL

 

The default is $OffdotL.

In report writing one may want to do calculations which reuse terms from the model .. equations in as close to original form as possible.  Also one often wished to compute tables of results as a function of the variable levels.  Before version 22.9 the only way to do this was with the .l notation as follows (macrotrnsport.gms)

zz2=sum((i,j),(x.l(i,j)));

 

where x is a model decision variable.

 

Today one can use $Ondotl which automatically includes attached the .l to any variables appearing on the right hand side which do not otherwise have a variable attribute extension.  In particular the following commands yield the same calculation as that above without the need to the .l's appended to the variable names.

 

$onDotL

zz=sum((i,j),(x(i,j)));

 

This feature was introduced to make macros more useful but is not limited to macros as illustrated above.

This feature once enabled applies to all subsequent instances where variables are on the right hand side of equations and can even be put in the first line of a model.

The command $offdotl turns off the implicit .l addition.