<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Adrian, in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985574#M100697</link>
    <description>&lt;P&gt;Hi Adrian,&lt;/P&gt;
&lt;P&gt;Could you consider always writing to the character array, then at the end of the routine check if the GUI flag is set, and if not loop through the character array and write to the file?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2013 13:26:03 GMT</pubDate>
    <dc:creator>Michael_Roberts</dc:creator>
    <dc:date>2013-11-15T13:26:03Z</dc:date>
    <item>
      <title>Getting write statement to write to unit or string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985572#M100695</link>
      <description>&lt;P&gt;I have a very large routine full of WRITE statements which write to a unit number (for file output).&amp;nbsp; This routine is now going to also be called by a GUI through a DLL, and in this case I want the WRITE statements to write to a character array instead of the file unit number.&amp;nbsp; (It must still be able to write to the unit number if not called from the GUI).&amp;nbsp; Now short of putting an IF statement around every WRITE statement, can I use a better method eg. using pointers to do it?&lt;/P&gt;
&lt;P&gt;Say I have:&lt;/P&gt;
&lt;P&gt;WRITE(IU,'(a,/,a)') 'test1', 'test2'&lt;/P&gt;
&lt;P&gt;And I want the same code to work if IU points to a character array (if called from the GUI)&lt;/P&gt;
&lt;P&gt;So I know I can say:&lt;/P&gt;
&lt;P&gt;INTEGER :: IU&lt;/P&gt;
&lt;P&gt;CHARACTER(256) :: CA(2)&lt;/P&gt;
&lt;P&gt;IF(GUI) then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WRITE(CA(1:2),'(a,/,a)') 'test1', 'test2'&lt;/P&gt;
&lt;P&gt;ELSE&lt;/P&gt;
&lt;P&gt;&amp;nbsp; WRITE(IU,'(a,/,a)') 'test1', 'test2'&lt;/P&gt;
&lt;P&gt;ENDIF&lt;/P&gt;
&lt;P&gt;but I'd prefer it if I can use then same code without the IF test, by some fancy footwork on IU and CA(2) beforehand so I wouln't have to modify every IF statement, eg.&lt;/P&gt;
&lt;P&gt;IF(GUI) THEN&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IU -&amp;gt; CA&amp;nbsp;&amp;nbsp; ! or whatever&lt;/P&gt;
&lt;P&gt;ENDIF&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 11:37:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985572#M100695</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2013-11-15T11:37:34Z</dc:date>
    </item>
    <item>
      <title>Actually I'll just change IU</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985573#M100696</link>
      <description>&lt;P&gt;Actually I'll just change IU into a character array, and then write the character aray into the file at the end of the routine!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 12:25:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985573#M100696</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2013-11-15T12:25:36Z</dc:date>
    </item>
    <item>
      <title>Hi Adrian,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985574#M100697</link>
      <description>&lt;P&gt;Hi Adrian,&lt;/P&gt;
&lt;P&gt;Could you consider always writing to the character array, then at the end of the routine check if the GUI flag is set, and if not loop through the character array and write to the file?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 13:26:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985574#M100697</guid>
      <dc:creator>Michael_Roberts</dc:creator>
      <dc:date>2013-11-15T13:26:03Z</dc:date>
    </item>
    <item>
      <title>Hi Michael, thanks that's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985575#M100698</link>
      <description>&lt;P&gt;Hi Michael, thanks that's what I did in the end.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2013 13:30:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Getting-write-statement-to-write-to-unit-or-string/m-p/985575#M100698</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2013-11-15T13:30:51Z</dc:date>
    </item>
  </channel>
</rss>

