<?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 In general with many sdk in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981169#M99796</link>
    <description>&lt;P&gt;In general with many sdk routines the functions return a NOK status and then you must call gestlasterr() to find out why.&amp;nbsp;I am not specifically calling getlasterror() after INQUIRE that in itself would be pointless.&amp;nbsp; This was just an example of the Fortan runtime leaving and error state handing that can be detected &amp;nbsp;at a later point.&lt;/P&gt;

&lt;P&gt;The specific diagnostic routine is some additional problem finding/validation and is not part of the normal error trapping and normal function of the program and indeed will not be present in the final version. For example in some routines (mostly new ones) there are some diagnostic trace on entry and exit.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;IanH's comment "&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;My recollection is that some windows API's will set the last error code to a non-zero value even if the API notionally succeeds (as determined by the API function result),&amp;nbsp;&lt;/SPAN&gt;" is indeed what the sdk documentation says but is not what &amp;nbsp;I have found to happen in practice in 99% of cases.&lt;/P&gt;

&lt;P&gt;@Paul, "&lt;FONT face="Arial, Helvetica, sans-serif"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;not ditch the antiquated Fortran file i/o" that is a possibility I was considering but I am reticent to go changing a whole ruck of code that isn't&amp;nbsp;broken&amp;nbsp;at&amp;nbsp;this point in time. It isn't a performance issue as the application&amp;nbsp;is not limited &amp;nbsp;by file i/o in ant way.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;@steve. Thanks for the info. I understand your point. I think it is rather mean the the runtime leaves the system with an error state that the coders knew they had created.It would have been more friendly to reset that..&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2014 07:52:32 GMT</pubDate>
    <dc:creator>andrew_4619</dc:creator>
    <dc:date>2014-02-11T07:52:32Z</dc:date>
    <item>
      <title>Windows errors for valid Fortan io</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981165#M99792</link>
      <description>&lt;P&gt;I have converted an application with an awful lot of &amp;nbsp;user interface from &amp;nbsp;QuickWin to Windows and am currently at the testing/fixing phase. As such I have a custom error trapping routine inserted all over the place looking at the windows error status from the sdk getlasterror() and logging such events along with a stack trace, error code etc.&lt;/P&gt;

&lt;P&gt;I seem to get an irritating number of 'false errors' from valid Fortran i/o, for example a Fortran INQUIRE statement on a file &amp;nbsp;with EXIST or IOSTAT generates a windows error code if the file does not exist. I expect the Fortran runtime provokes windows by trying to open the file and then returns the Fortran status based on that status. It would seem to be a bit more friendly if the Fortran runtime reset and spurious errors that it generated.&lt;/P&gt;

&lt;P&gt;Are there any options that would work around this? I suppose I could start replacing Fortran with Sdk file utilities.but that seems like wasted effort.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 01:23:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981165#M99792</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-02-11T01:23:41Z</dc:date>
    </item>
    <item>
      <title>Why are you calling</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981166#M99793</link>
      <description>&lt;P&gt;Why are you calling GetLastError after INQUIRE?&lt;/P&gt;

&lt;P&gt;Could you strategically use SetLastError prior to the operation that your error trapping really covers?&lt;/P&gt;

&lt;P&gt;My recollection is that some windows API's will set the last error code to a non-zero value even if the API notionally succeeds (as determined by the API function result), so using GetLastError alone for error detection is going to give you false positives.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 01:40:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981166#M99793</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2014-02-11T01:40:36Z</dc:date>
    </item>
    <item>
      <title>I agree with Ian --</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981167#M99794</link>
      <description>&lt;P&gt;I agree with Ian -- GetLastError() is only for use immediately following a WinAPI call. IVF provides no information on how various Fortran statements are realized as API calls, so the results from calling GLE in an indirect context will be neither meaningful nor correct.&lt;/P&gt;

&lt;P&gt;Suggestion: if you're really trying to implement Windows code using Fortran, why not ditch the antiquated Fortran file i/o altogether and use the direct WinAPI handle-based file routines instead?&amp;nbsp; In my experience, they provide much better performance, are easier to use, and also allow vastly improved granular control over i/o.&amp;nbsp; I have posted code samples several times to this forum.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 01:56:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981167#M99794</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2014-02-11T01:56:45Z</dc:date>
    </item>
    <item>
      <title>Yes, INQUIRE tries to open</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981168#M99795</link>
      <description>&lt;P&gt;Yes, INQUIRE tries to open the file to see if it exists and is openable by Fortran. As others have said, don't look at GetLastError after a Fortran I/O operation - especially an INQUIRE.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 03:59:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981168#M99795</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-02-11T03:59:14Z</dc:date>
    </item>
    <item>
      <title>In general with many sdk</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981169#M99796</link>
      <description>&lt;P&gt;In general with many sdk routines the functions return a NOK status and then you must call gestlasterr() to find out why.&amp;nbsp;I am not specifically calling getlasterror() after INQUIRE that in itself would be pointless.&amp;nbsp; This was just an example of the Fortan runtime leaving and error state handing that can be detected &amp;nbsp;at a later point.&lt;/P&gt;

&lt;P&gt;The specific diagnostic routine is some additional problem finding/validation and is not part of the normal error trapping and normal function of the program and indeed will not be present in the final version. For example in some routines (mostly new ones) there are some diagnostic trace on entry and exit.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;IanH's comment "&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;My recollection is that some windows API's will set the last error code to a non-zero value even if the API notionally succeeds (as determined by the API function result),&amp;nbsp;&lt;/SPAN&gt;" is indeed what the sdk documentation says but is not what &amp;nbsp;I have found to happen in practice in 99% of cases.&lt;/P&gt;

&lt;P&gt;@Paul, "&lt;FONT face="Arial, Helvetica, sans-serif"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;not ditch the antiquated Fortran file i/o" that is a possibility I was considering but I am reticent to go changing a whole ruck of code that isn't&amp;nbsp;broken&amp;nbsp;at&amp;nbsp;this point in time. It isn't a performance issue as the application&amp;nbsp;is not limited &amp;nbsp;by file i/o in ant way.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;@steve. Thanks for the info. I understand your point. I think it is rather mean the the runtime leaves the system with an error state that the coders knew they had created.It would have been more friendly to reset that..&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 07:52:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Windows-errors-for-valid-Fortan-io/m-p/981169#M99796</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-02-11T07:52:32Z</dc:date>
    </item>
  </channel>
</rss>

