title: How to write a while loop in GAMS
body: <p>Can anyone help me with this problem please. I want to add to i one by one and put the amount of x(i) equal to 1 in each step, so i wrote it as below but it's not working</p>
  
  <pre><code>loop(i,
      x('0')=1;
      t('0')=1;
  while(t&gt;m,
        ord(i)=ord(i)+1;
        display i;
        x(i)=1;
        display x;
        t(i)=t(i-1) +1;
     );
   );
  </code></pre>
  
  <p>And by the way m is a variable which is calculated before this, in an equation.</p>