<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to For loops</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/248d814dd3/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/248d814dd3/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/248d814dd3/</id><updated>2020-02-27T23:07:14.721000Z</updated><subtitle>Recent posts to For loops</subtitle><entry><title>For loops</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/248d814dd3/?limit=25#8386" rel="alternate"/><published>2020-02-27T23:07:14.721000Z</published><updated>2020-02-27T23:07:14.721000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.com9799aa192c24dde36c9f67f3ddbf4bbbfe0f131b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;There if you want to leave a loop you can also use the EXIT command.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="nv"&gt;scounter&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nv"&gt;to&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="k"&gt;DO&lt;/span&gt;
    &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="nv"&gt;scounter&lt;/span&gt;] &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;255&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
        &lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="nv"&gt;scounter&lt;/span&gt;] :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;data&lt;/span&gt;[&lt;span class="nv"&gt;scounter&lt;/span&gt;] &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;ELSE&lt;/span&gt;
        &lt;span class="k"&gt;EXIT&lt;/span&gt;&lt;span class="c1"&gt;;      (* This will terminate the for loop *)&lt;/span&gt;
    &lt;span class="nv"&gt;END_IF&lt;/span&gt;
&lt;span class="nv"&gt;END_FOR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>For loops</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/248d814dd3/?limit=25#3a34" rel="alternate"/><published>2020-02-27T23:07:13.096000Z</published><updated>2020-02-27T23:07:13.096000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com455d8ca63e42810cb9a722382558cf05bc46abdf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If you put the var higher as the to value it will not enter the loop, (except when to value is 127 in SINT, then it will never end.)&lt;br/&gt;
and you can check with IF statement. (in some cases RETURN works as it will leave a POU)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>For loops</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/248d814dd3/?limit=25#0b78" rel="alternate"/><published>2020-02-27T23:07:08.528000Z</published><updated>2020-02-27T23:07:08.528000Z</updated><author><name>Elric</name><uri>https://forge.codesys.com/u/elric/</uri></author><id>https://forge.codesys.com8b5803bea97f7cf858801779d122a51d6d30ca0d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all.&lt;/p&gt;
&lt;p&gt;Is there ANYTHING in CodeSys that allows you to force a for loop block to move to the next iteration?  Like the "continue" command in most other languages?  Is there an equivalent?&lt;/p&gt;
&lt;p&gt;Elric.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>