<?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 Re: Error using Internal WRITE in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934619#M15535</link>
    <description>If you're calling a DLL from Visual Basic, and the DLL code gets an error, VB just dies - there's nothing Fortran can do about it.    One of the things that can cause an error is to do a write to a non-existent console, which is where the AllocConsole comes in.&lt;BR /&gt;&lt;BR /&gt;The point to remember here is that it is the "main program" that determines the error handling behavior - if you're calling from a Fortran or C console application, everything works fine.  If you call a DLL from VB, then you had better hope that nothing goes wrong.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Sat, 13 Jan 2001 02:50:47 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2001-01-13T02:50:47Z</dc:date>
    <item>
      <title>Error using Internal WRITE</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934615#M15531</link>
      <description>I have been having an problem using internal write with a library  &lt;BR /&gt;I created in Fortran. I am using CVF 6.1 and have VS 6.0 SP4. The  &lt;BR /&gt;problem is that the following typical code causes any windows program &lt;BR /&gt;to crash. If I create a console application it works just fine. &lt;BR /&gt;I have tried creating a LIB and an DLL and the problem is  &lt;BR /&gt;the same. &lt;BR /&gt; &lt;BR /&gt;I need to format data into character string that will be outputted &lt;BR /&gt;to another application or returned to the calling program. Here is &lt;BR /&gt;how I have been doing it in the past. Also, I have tried a lot &lt;BR /&gt;of different permutations, but I must have just missed something. &lt;BR /&gt; &lt;BR /&gt;      CHARACTER*1024 BUFFER &lt;BR /&gt;      ! or CHARACTER*1 BUFFER(1024) &lt;BR /&gt;      . &lt;BR /&gt;      . &lt;BR /&gt;      . &lt;BR /&gt;      WRITE(BUFFER,'(A)') 'Program Finished' &lt;BR /&gt;      ! or  WRITE(BUFFER,100) 'Program Finished' &lt;BR /&gt;      ! 100 FORMAT(A) &lt;BR /&gt; &lt;BR /&gt;ENCODE works in a few places, but I would rather not change nearly &lt;BR /&gt;500 lines of code where these statements are located. &lt;BR /&gt; &lt;BR /&gt;Any suggestions would be welcomed. &lt;BR /&gt; &lt;BR /&gt;Thanks for any help.</description>
      <pubDate>Fri, 12 Jan 2001 16:56:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934615#M15531</guid>
      <dc:creator>lenocker</dc:creator>
      <dc:date>2001-01-12T16:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Internal WRITE</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934616#M15532</link>
      <description>WRITE(BUFFER,'(A)') 'Program Finished' should not work with CHARACTER*1 BUFFER(1024) (an array with 1024 elements one character long each). &lt;BR /&gt; &lt;BR /&gt;Sabalan.</description>
      <pubDate>Fri, 12 Jan 2001 19:04:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934616#M15532</guid>
      <dc:creator>sabalan</dc:creator>
      <dc:date>2001-01-12T19:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Internal WRITE</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934617#M15533</link>
      <description>Fortran Windows programs do crash (typically just disappearing, without any error message) when a I/O error _or_ OUTPUT TO SCREEN (Write (*))is encountered in fortran code. &lt;BR /&gt; &lt;BR /&gt;Now, there's nothing wrong in the code you posted, but perhaps there &lt;BR /&gt;is something wrong in the actual code. My guess is that you have output to screen somewhere. You can remove it or change it to write to a file, or &lt;BR /&gt;put AllocConsole call on the beginning and FreeConsole at the end of the fortran code, which would create a console window. &lt;BR /&gt; &lt;BR /&gt;If that's not the case, try adding IOSTAT=iError in WRITE statement and &lt;BR /&gt;examine the value of iError after that. If that's 0, everything is OK; otherwise, it's an I/O error code (meanings can be found somewhere in &lt;BR /&gt;programmers' guide). &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Fri, 12 Jan 2001 23:16:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934617#M15533</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-01-12T23:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Internal WRITE</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934618#M15534</link>
      <description>I thank Sabalan and Jugoslav for their suggestions. In reply to Sabalan, I have tried every combination of CHARACTER*1024 BUFFER and CHARACTER*1 BUFFER(1024) in combination with WRITE(BUFFER,'(A)'), BUFFER and WRITE(BUFFER,'(1024A)'). I have use the formatting in a FORMAT statement as well. Every combination works in a console application and has for ten years.  &lt;BR /&gt; &lt;BR /&gt;I will try AllocConsole as Jugoslav suggested today and see what happens. The error check should help too.</description>
      <pubDate>Sat, 13 Jan 2001 01:47:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934618#M15534</guid>
      <dc:creator>lenocker</dc:creator>
      <dc:date>2001-01-13T01:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error using Internal WRITE</title>
      <link>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934619#M15535</link>
      <description>If you're calling a DLL from Visual Basic, and the DLL code gets an error, VB just dies - there's nothing Fortran can do about it.    One of the things that can cause an error is to do a write to a non-existent console, which is where the AllocConsole comes in.&lt;BR /&gt;&lt;BR /&gt;The point to remember here is that it is the "main program" that determines the error handling behavior - if you're calling from a Fortran or C console application, everything works fine.  If you call a DLL from VB, then you had better hope that nothing goes wrong.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Sat, 13 Jan 2001 02:50:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Error-using-Internal-WRITE/m-p/934619#M15535</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-01-13T02:50:47Z</dc:date>
    </item>
  </channel>
</rss>

