Endfor

Top  Previous  Next

Ordinarily For statements are of the form

 

For(scalar=limits,

  statements ;

) ;

 

and when $Onend is specified the statement becomes

 

$Onend

For scalar=limits do

     statements ;

endfor;

Example:

(control.gms)

The following two commands are equivalent and illustrate the ways the syntax varies.

 

for(x=1 downto 12 by 2,

    data(i)=x;

   );

$Onend

for x=1 downto 12 by 2do

    data(i)=x;

   endfor;