<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Read statement issues]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=593</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=593&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Read statement issues.]]></description>
		<lastBuildDate>Mon, 21 Nov 2016 12:33:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Read statement issues]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2698#p2698</link>
			<description><![CDATA[<p>Bob,</p><p>I&#039;m not having that issue with your code.&nbsp; My grid file contains:</p><div class="codebox"><pre><code>000600400
700003600
000091080
000000000
050180003
000306045
040200060
903000000
020000100</code></pre></div><p>and my program is:</p><div class="codebox"><pre><code>program sud2
implicit none

integer, dimension (9, 9) :: grid

    integer :: i
    integer :: j
    OPEN (UNIT=5,FILE=&#039;Grid92.txt&#039;)
    do i=1,9
           Read(5, &#039;(9I1)&#039;) (grid(i,j), j=1,9)
           Print *, (grid(i,j), j=1,9)
    end do
    close(5)
        
end program sud2</code></pre></div><p>When I run this code, I get:</p><div class="codebox"><pre><code>           0           0           0           6           0           0           4           0           0
           7           0           0           0           0           3           6           0           0
           0           0           0           0           9           1           0           8           0
           0           0           0           0           0           0           0           0           0
           0           5           0           1           8           0           0           0           3
           0           0           0           3           0           6           0           4           5
           0           4           0           2           0           0           0           6           0
           9           0           3           0           0           0           0           0           0
           0           2           0           0           0           0           1           0           0</code></pre></div><p>as I would expect to.&nbsp; I would point out that using <em>UNIT=5</em> can be dangerous, and I don&#039;t recommend it normally.&nbsp; What version of Simply Fortran are you working with?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Mon, 21 Nov 2016 12:33:30 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2698#p2698</guid>
		</item>
		<item>
			<title><![CDATA[Read statement issues]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2697#p2697</link>
			<description><![CDATA[<p>000600400<br />700003600<br />000091080<br />000000000<br />050180003<br />000306045<br />040200060<br />903000000<br />020000100<br />xxxxxxxxx<br />xxxxxxxxx</p><p>Above is a win10 notepad&nbsp; text file read by<br />relevant code which follows:<br />! Sudoku Grid<br />integer, dimension (9, 9) :: grid<br />implicit none<br />&nbsp; &nbsp; integer :: i<br />&nbsp; &nbsp; integer :: j<br />OPEN (UNIT=5,FILE=&#039;D:\\Grid92.txt&#039;)<br />do i=1,9 <br />&nbsp; &nbsp; &nbsp; &nbsp;Read(5, &#039;(9I1)&#039;) (grid(i,j), j=1,9)<br />end do</p><p>If you remove the two x lines<br />does the read statement&nbsp; fail ?<br />If so, why ?<br />Bob</p>]]></description>
			<author><![CDATA[null@example.com (Bob)]]></author>
			<pubDate>Sat, 19 Nov 2016 00:44:44 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2697#p2697</guid>
		</item>
	</channel>
</rss>
