<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Console screen, more]]></title>
	<link rel="self" href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=354&amp;type=atom" />
	<updated>2024-08-15T19:57:05Z</updated>
	<generator>PunBB</generator>
	<id>http://forums.approximatrix.com/viewtopic.php?id=354</id>
		<entry>
			<title type="html"><![CDATA[Re: Console screen, more]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=4358#p4358" />
			<content type="html"><![CDATA[<p>Jeff,</p><p>I&#039;m also confused about the Fortran 2008 &quot;Newunit&quot; identifier.</p><p>When not using &quot;Newunit&quot;, an external unit identifier refers to an external file that is represented by an integer expression. The integer expression has one of the following values in the range 1 through 2147483647</p><p>When using &quot;Newunit&quot;, Fortran 2008 standard requires that the unit number that comes back with the NEWUNIT specifier be a negative number. </p><p>INTEL Documentation says that NEWUNIT = u-var<br />Is a scalar integer variable that is assigned the automatically chosen unit number. It is always a negative integer. </p><p>IBM Documentation says that NEWUNIT= var (Fortran 2008) is an input/output specifier that specifies the NEWUNIT value for the connection. var is a scalar default integer variable. The NEWUNIT value is a negative number that is less than -2 and is unequal to the unit number of any currently connected file.</p><p>I&#039;ve also read that it is less than -1. But my question is, can these negative unit numbers be easily turned into positive numbers for use in Input/Output?</p><p>Or should we use,</p><p>&nbsp; &nbsp; iunit = 0<br />&nbsp; &nbsp; do i = 100, 999<br />&nbsp; &nbsp; &nbsp; &nbsp; inquire ( unit = i, opened = lopen, iostat = ios )</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ( ios == 0 ) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( .not. lopen ) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iunit = i<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end if<br />&nbsp; &nbsp; &nbsp; &nbsp; end if<br />&nbsp; &nbsp; end do</p><p>Frank</p>]]></content>
			<author>
				<name><![CDATA[drfrank]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=223</uri>
			</author>
			<updated>2024-08-15T19:57:05Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=4358#p4358</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Console screen, more]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=4357#p4357" />
			<content type="html"><![CDATA[<p>Units 5 and 6 in Simply Fortran&#039;s compiler refer to standard input and standard output by default.&nbsp; This assignment is pretty common in other Fortran compilers as well.&nbsp; When you use an OPEN statement and refer to either unit, your program will no longer be able to read from standard input (the keyboard) and/or write to standard output (the screen).&nbsp; Our compiler now warns during compilation if an OPEN statement attempts to use either unit.</p><p>Unit numbers under 20 have historically had special meanings depending on the compiler, platform, etc.&nbsp; It is best to either allow Fortran to manage unit numbers using the <em>newunit</em> specifier:</p><div class="codebox"><pre><code>OPEN(newunit=unum, file=&quot;output.txt&quot;, status=&quot;unknown&quot;, action=&quot;write&quot;)</code></pre></div><p>or use unit numbers that are over 100.&nbsp; Single digit unit numbers can be problematic depending on your compiler and/or platform.&nbsp; With our compiler, units 5 and 6 can be highly problematic to reassign.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2024-08-15T12:22:31Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=4357#p4357</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Console screen, more]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=4356#p4356" />
			<content type="html"><![CDATA[<p>Hello, I find this a rather strange message.<br />What about reserving units 5 and (screen and printer) ?<br />Can you give a word more about it?</p>]]></content>
			<author>
				<name><![CDATA[McTes]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=4190</uri>
			</author>
			<updated>2024-08-14T16:51:19Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=4356#p4356</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Console screen, more]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1435#p1435" />
			<content type="html"><![CDATA[<p>I&nbsp; tried reserving&nbsp; units 5 &amp; 6 and now the console screen works ok.<br />Thanks</p>]]></content>
			<author>
				<name><![CDATA[mtmisery1682]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3551</uri>
			</author>
			<updated>2014-06-16T18:28:04Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1435#p1435</id>
		</entry>
</feed>
