<?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: run-time error messages in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963042#M22280</link>
    <description>BTW, what are the correct values for the first two parameters?  &lt;BR /&gt;Here is what I'm using, but the message returned is always composed of junk characters: &lt;BR /&gt; &lt;BR /&gt;              LAST_ERROR = GETLASTERROR()   ! is returning a system code &lt;BR /&gt;		 &lt;BR /&gt;              CALL FORMATMESSAGE(   &lt;BR /&gt;     +                         FORMAT_MESSAGE_ALLOCATE_BUFFER .OR. &lt;BR /&gt;     +                                         FORMAT_MESSAGE_FROM_SYSTEM, &lt;BR /&gt;     +                         NULL, &lt;BR /&gt;     +                         LAST_ERROR,  &lt;BR /&gt;     +                         0, &lt;BR /&gt;     +                         ERROR_MSG, &lt;BR /&gt;     +                         0, &lt;BR /&gt;     +                         NULL ) &lt;BR /&gt; &lt;BR /&gt;         WRITE(*,*) ERROR_MSG  ! declared as CHARACTER*(80) &lt;BR /&gt;         ! value returned is composed of WingDings style characters</description>
    <pubDate>Wed, 15 Aug 2001 04:43:27 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-08-15T04:43:27Z</dc:date>
    <item>
      <title>run-time error messages</title>
      <link>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963040#M22278</link>
      <description>I have just returned to using Visual Fortran after a gap of about 3 years. With the version at that time (version 5?) I was able to get at the text of system error messages (e.g. after using an ERR=) by :-    &lt;BR /&gt;    &lt;BR /&gt;call errsns (, code)  ! --- Fortran intrinsic    &lt;BR /&gt;call FormatMessage (..., code, ..., message, ...)  ! --- DFWIN    &lt;BR /&gt;    &lt;BR /&gt;to give me message texts like "The system cannot find the file specified."     &lt;BR /&gt;    &lt;BR /&gt;But if I use this now, then the call to errsns returns zero and not the system error code that I expected. Is this change in operation intentional, and if so then how can I get at the texts of system error messages.    &lt;BR /&gt;    &lt;BR /&gt;geoff wright    &lt;BR /&gt;computable functions</description>
      <pubDate>Tue, 14 Aug 2001 23:03:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963040#M22278</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-14T23:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: run-time error messages</title>
      <link>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963041#M22279</link>
      <description>I suggest sending an example of the problem to vf-support@compaq.com.  I am not aware of any changes in this area, but the experts for this don't read this forum.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 14 Aug 2001 23:56:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963041#M22279</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-08-14T23:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: run-time error messages</title>
      <link>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963042#M22280</link>
      <description>BTW, what are the correct values for the first two parameters?  &lt;BR /&gt;Here is what I'm using, but the message returned is always composed of junk characters: &lt;BR /&gt; &lt;BR /&gt;              LAST_ERROR = GETLASTERROR()   ! is returning a system code &lt;BR /&gt;		 &lt;BR /&gt;              CALL FORMATMESSAGE(   &lt;BR /&gt;     +                         FORMAT_MESSAGE_ALLOCATE_BUFFER .OR. &lt;BR /&gt;     +                                         FORMAT_MESSAGE_FROM_SYSTEM, &lt;BR /&gt;     +                         NULL, &lt;BR /&gt;     +                         LAST_ERROR,  &lt;BR /&gt;     +                         0, &lt;BR /&gt;     +                         ERROR_MSG, &lt;BR /&gt;     +                         0, &lt;BR /&gt;     +                         NULL ) &lt;BR /&gt; &lt;BR /&gt;         WRITE(*,*) ERROR_MSG  ! declared as CHARACTER*(80) &lt;BR /&gt;         ! value returned is composed of WingDings style characters</description>
      <pubDate>Wed, 15 Aug 2001 04:43:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963042#M22280</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-15T04:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: run-time error messages</title>
      <link>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963043#M22281</link>
      <description>Thank, GetLastError seems to do the trick, but it doesn't explain why ERRSNS has stopped returning the system error code.  &lt;BR /&gt;  &lt;BR /&gt;My code to get the message text is:-  &lt;BR /&gt;  &lt;BR /&gt;    character*256 message  &lt;BR /&gt;    integer*4 msg_len  &lt;BR /&gt;  &lt;BR /&gt;    msg_len = FormatMessage (  &lt;BR /&gt;        (FORMAT_MESSAGE_FROM_SYSTEM .OR.  &lt;BR /&gt;         FORMAT_MESSAGE_IGNORE_INSERTS .OR.  &lt;BR /&gt;         FORMAT_MESSAGE_MAX_WIDTH_MASK),  &lt;BR /&gt;        %val(0), code, 0, message, len(message), 0)  &lt;BR /&gt;    message(msg_len+1:msg_len+1) = ' '  &lt;BR /&gt;  &lt;BR /&gt;But remember that this was written many years ago when I thought that I understood what I was doing. I do know that the last line was there to remove the null that terminated the C-style string.  &lt;BR /&gt;  &lt;BR /&gt;geoff</description>
      <pubDate>Wed, 15 Aug 2001 21:19:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963043#M22281</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-08-15T21:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: run-time error messages</title>
      <link>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963044#M22282</link>
      <description>&lt;P&gt;Under Visual FORTRAN 6.6A (OS Windows) I have gotten calls to the win32 functions GETLASTERROR and FORMATMESSAGE to work:&lt;BR /&gt;
	&lt;BR /&gt;
	subroutine Report_Sys_Error()&lt;BR /&gt;
	! When a win32 routine has returned an error code&lt;BR /&gt;
	! call this subroutine.&lt;BR /&gt;
	! LpBuffer below is the win32 error message&lt;BR /&gt;
	&lt;BR /&gt;
	USE DFWIN&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;BR /&gt;
	integer(DWORD) dwFlags ! DWORD dwFlags&lt;BR /&gt;
	integer(LPCVOID) lpSource ! LPCVOID lpSource&lt;BR /&gt;
	integer(DWORD) dwMessageId ! DWORD dwMessageId&lt;BR /&gt;
	integer(DWORD) dwLanguageId ! DWORD dwLanguageId&lt;BR /&gt;
	character*256 lpBuffer ! LPSTR lpBuffer&lt;BR /&gt;
	! integer(DWORD) nSize ! DWORD nSize&lt;BR /&gt;
	TYPE(T_VA_LIST) Arguments ! va_list* Arguments&lt;BR /&gt;
	&lt;BR /&gt;
	INTEGER FuncOut, IER&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;BR /&gt;
	ier= GetLastError()&lt;BR /&gt;
	&lt;BR /&gt;
	DWflags = IOR(FORMAT_MESSAGE_IGNORE_INSERTS,FORMAT_MESSAGE_FROM_SYSTEM)&lt;BR /&gt;
	&lt;BR /&gt;
	dwLanguageId = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)&lt;BR /&gt;
	&lt;BR /&gt;
	FuncOut = FormatMessage_G1( &amp;amp;&lt;BR /&gt;
	dwFlags, &amp;amp;&lt;BR /&gt;
	NULL, &amp;amp; ! lpSource,&lt;BR /&gt;
	ier, &amp;amp;&lt;BR /&gt;
	dwLanguageId, &amp;amp;&lt;BR /&gt;
	lpBuffer, &amp;amp;&lt;BR /&gt;
	len(lpBuffer), &amp;amp;&lt;BR /&gt;
	Arguments)&lt;BR /&gt;
	&lt;BR /&gt;
	! Write to the error message to console if this a console application&lt;BR /&gt;
	! write(*,*) 'Error: ' // lpBuffer&lt;BR /&gt;
	&lt;BR /&gt;
	end subroutine Report_Sys_Error&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2002 05:31:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/run-time-error-messages/m-p/963044#M22282</guid>
      <dc:creator>Deleted_U_Intel</dc:creator>
      <dc:date>2002-11-07T05:31:00Z</dc:date>
    </item>
  </channel>
</rss>

