break from a loop

Hi,
I was wondering if any of you know how to leave a loop using a
command such as “break” in other languages.
Thanks,

\

There is no break command in GAMS. But you can use a scalar together with if to break as below:

scalar stop /0/

loop(k$(stop=0),


if(your condition,
stop=1;
);
);

\

Date: Wed, 7 Mar 2012 21:41:31 -0800
Subject: break from a loop
From: entropy053@gmail.com
To: gamsworld@googlegroups.com

Hi,
I was wondering if any of you know how to leave a loop using a
command such as “break” in other languages.
Thanks,


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.