<?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: Clear error after call to GETLASTERRORQQ in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859612#M68658</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/142656"&gt;David White&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/379158"&gt;g.f.thomas&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Use the Win API. IIRC do something like&lt;BR /&gt;&lt;BR /&gt;errres=GetLastError()&lt;BR /&gt;Call SetLastError(errres)&lt;BR /&gt;&lt;BR /&gt;Gerry&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Gerry,&lt;BR /&gt;&lt;BR /&gt;I think it will actually need&lt;BR /&gt;Call SetLastError(0)&lt;BR /&gt;to clear the error.&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I more or less agree. The last time I used this I did&lt;BR /&gt;&lt;BR /&gt;USE IFWINTY&lt;BR /&gt;USE KERNEL32&lt;BR /&gt;IF(GETLASTERROR() /= ERROR_SUCCESS) CALL SETLASTERROR(ERROR_SUCCESS)&lt;BR /&gt;&lt;BR /&gt;Gerry&lt;BR /&gt;</description>
    <pubDate>Fri, 30 Jan 2009 15:00:13 GMT</pubDate>
    <dc:creator>g_f_thomas</dc:creator>
    <dc:date>2009-01-30T15:00:13Z</dc:date>
    <item>
      <title>Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859605#M68651</link>
      <description>I am trying to detect when a file on a network drive is accessible. I can detect when there is a problem using GETFILEINFOQQ and GETLASTERRORQQ. I then get the app to wait for a period and then retry. If the resource is available, then GETFILEINFOQQ is successful, but the last error is still reported.&lt;BR /&gt;&lt;BR /&gt;Is there any way to clear the last error once the error has been handled (by waiting in my example)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Thu, 22 Jan 2009 04:41:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859605#M68651</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-01-22T04:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859606#M68652</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/142656"&gt;David White&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I am trying to detect when a file on a network drive is accessible. I can detect when there is a problem using GETFILEINFOQQ and GETLASTERRORQQ. I then get the app to wait for a period and then retry. If the resource is available, then GETFILEINFOQQ is successful, but the last error is still reported.&lt;BR /&gt;&lt;BR /&gt;Is there any way to clear the last error once the error has been handled (by waiting in my example)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Why dont you use the handle that GETFILEINFOQQ returns? It has the value FILE$ERROR if the file dont exist...&lt;BR /&gt;&lt;BR /&gt;When debug, in the first run it steps into i=1, then I copy the file, debug further and then I geti=2.&lt;BR /&gt;&lt;BR /&gt;Markus&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;[cpp]handle = FILE$FIRST
result = GETFILEINFOQQ (files, info, handle)
if(handle==file$error) then
    i = 1
else
    i = 2
end if

! copying file to the right dir

handle = FILE$FIRST
result = GETFILEINFOQQ (files, info, handle)
if(handle==file$error) then
    i = 1
else
    i = 2
end if[/cpp]&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jan 2009 08:18:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859606#M68652</guid>
      <dc:creator>onkelhotte</dc:creator>
      <dc:date>2009-01-22T08:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859607#M68653</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/90977"&gt;onkelhotte&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Why dont you use the handle that GETFILEINFOQQ returns? It has the value FILE$ERROR if the file dont exist...&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I wanted more specific information about the cause of the error, so I was using GETLASTERRORQQ. However my logic in checking for FILE$ERROR was incorrect, which meant I was checking the last error even when the last call had not flaggedan error.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jan 2009 00:36:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859607#M68653</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-01-23T00:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859608#M68654</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/142656"&gt;David White&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I wanted more specific information about the cause of the error, so I was using GETLASTERRORQQ. However my logic in checking for FILE$ERROR was incorrect, which meant I was checking the last error even when the last call had not flaggedan error.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Youre right, this doesnt solve the GETLASTERRORQQ problem... But finding your file problem ;-)&lt;BR /&gt;&lt;BR /&gt;So, when you use a function or subroutine, that can produce an error that is recognised by GETLASTERRORQQ you cannot say if it is the same error (and the result has the same value) or if there was no error at all and the value doesnt change because of that. Doesnt the doctor have a cure or suggestion?&lt;BR /&gt;&lt;BR /&gt;Markus</description>
      <pubDate>Fri, 23 Jan 2009 06:15:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859608#M68654</guid>
      <dc:creator>onkelhotte</dc:creator>
      <dc:date>2009-01-23T06:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859609#M68655</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I don't know of a way to clear the error code, but you might consider the Win32 API GetLastError() to see if it better meets your needs. However, I generally don't ask for the "last error" unless an operation has returned to me with a status saying it failed. Calling GETLASTERRORQQ repeatedly does not seem to me to fit in with its design.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jan 2009 14:33:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859609#M68655</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-01-23T14:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859610#M68656</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/142656"&gt;David White&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I am trying to detect when a file on a network drive is accessible. I can detect when there is a problem using GETFILEINFOQQ and GETLASTERRORQQ. I then get the app to wait for a period and then retry. If the resource is available, then GETFILEINFOQQ is successful, but the last error is still reported.&lt;BR /&gt;&lt;BR /&gt;Is there any way to clear the last error once the error has been handled (by waiting in my example)?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Use the Win API. IIRC do something like&lt;BR /&gt;&lt;BR /&gt;errres=GetLastError()&lt;BR /&gt;Call SetLastError(errres)&lt;BR /&gt;&lt;BR /&gt;Gerry&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 02:40:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859610#M68656</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2009-01-30T02:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859611#M68657</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/379158"&gt;g.f.thomas&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Use the Win API. IIRC do something like&lt;BR /&gt;&lt;BR /&gt;errres=GetLastError()&lt;BR /&gt;Call SetLastError(errres)&lt;BR /&gt;&lt;BR /&gt;Gerry&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Gerry,&lt;BR /&gt;&lt;BR /&gt;I think it will actually need&lt;BR /&gt;Call SetLastError(0)&lt;BR /&gt;to clear the error.&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 05:15:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859611#M68657</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-01-30T05:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Clear error after call to GETLASTERRORQQ</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859612#M68658</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/142656"&gt;David White&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/379158"&gt;g.f.thomas&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Use the Win API. IIRC do something like&lt;BR /&gt;&lt;BR /&gt;errres=GetLastError()&lt;BR /&gt;Call SetLastError(errres)&lt;BR /&gt;&lt;BR /&gt;Gerry&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Gerry,&lt;BR /&gt;&lt;BR /&gt;I think it will actually need&lt;BR /&gt;Call SetLastError(0)&lt;BR /&gt;to clear the error.&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I more or less agree. The last time I used this I did&lt;BR /&gt;&lt;BR /&gt;USE IFWINTY&lt;BR /&gt;USE KERNEL32&lt;BR /&gt;IF(GETLASTERROR() /= ERROR_SUCCESS) CALL SETLASTERROR(ERROR_SUCCESS)&lt;BR /&gt;&lt;BR /&gt;Gerry&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Jan 2009 15:00:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Clear-error-after-call-to-GETLASTERRORQQ/m-p/859612#M68658</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2009-01-30T15:00:13Z</dc:date>
    </item>
  </channel>
</rss>

