<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — DO LOOP not executing?]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=881</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=881&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in DO LOOP not executing?.]]></description>
		<lastBuildDate>Fri, 13 Jan 2023 17:39:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: DO LOOP not executing?]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=4038#p4038</link>
			<description><![CDATA[<p>For the fun of it, you could investigate do i = -0, -1</p><p>Zero is a funny critter. It can get you into trouble in programming and roulette.</p>]]></description>
			<author><![CDATA[null@example.com (designer)]]></author>
			<pubDate>Fri, 13 Jan 2023 17:39:31 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=4038#p4038</guid>
		</item>
		<item>
			<title><![CDATA[Re: DO LOOP not executing?]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=4036#p4036</link>
			<description><![CDATA[<p>You should think of the second number in the do loop as the inclusive point that will be the final loop step.&nbsp; The problem with</p><div class="codebox"><pre><code>do i = 0, -1</code></pre></div><p>is that the variable <em>i</em> already falls outside the inclusive stopping point of <em>-1</em>, so the loop never executes.&nbsp; In contrast, the line</p><div class="codebox"><pre><code>do i = 0, 0</code></pre></div><p>starts with a value of <em>i</em> that <em>does</em> fall within the inclusive upper limit of <em>0</em>, and the inner code block executes.</p><p>I believe the Fortran 66 standard actually did guarantee that loops would execute at least once regardless of conditions, but that behavior is no longer the standard as of Fortran 77.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 10 Jan 2023 21:19:25 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=4036#p4036</guid>
		</item>
		<item>
			<title><![CDATA[DO LOOP not executing?]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=4035#p4035</link>
			<description><![CDATA[<p>Getting back into Fortran after many years..................</p><p>The following DO LOOP does not show up as either an error or warning when editing the code:</p><br /><p>implicit none</p><p>integer:: i = 0</p><p>do i = 0, -1<br />&nbsp; write (*,*)&#039;hello!&#039;<br />end do</p><p>the program compiles just fine, and when you launch it, it runs but you never see &quot;hello!&quot;.</p><p>My somewhat spotty memory is that one can do negative increments on DO loops, but the proper syntax would be something like</p><p>do i = 0, -10, -1</p><p>My first thought is perhaps the do loop is not executing because</p><p>do i = 0, -1, 1 is the same as do i = 0,0</p><p>however, using do i = 0,0 does execute the loop, and you see &quot;hello!&quot;.</p><p>Now with that said, I am saving the program with .for extension, which I assume triggers the F66 &amp; F77 compiler standards, but still seems weird.</p><p>Thoughts?</p>]]></description>
			<author><![CDATA[null@example.com (Lewist57)]]></author>
			<pubDate>Tue, 10 Jan 2023 00:44:39 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=4035#p4035</guid>
		</item>
	</channel>
</rss>
