<?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 Is it possible to read the last line written on the console? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793160#M33705</link>
    <description>You're welcome!</description>
    <pubDate>Wed, 10 Nov 2010 11:15:47 GMT</pubDate>
    <dc:creator>anthonyrichards</dc:creator>
    <dc:date>2010-11-10T11:15:47Z</dc:date>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793153#M33698</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to know if the following is possible: is there a way in Fortran to read the previously output line of text on the console screen? I would like to know if that line was blank or not.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Olivier</description>
      <pubDate>Fri, 05 Nov 2010 18:11:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793153#M33698</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2010-11-05T18:11:42Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793154#M33699</link>
      <description>No - the consoile contents are not readable once written.</description>
      <pubDate>Fri, 05 Nov 2010 18:13:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793154#M33699</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-11-05T18:13:25Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793155#M33700</link>
      <description>In Windows...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;H1&gt;&lt;A&gt;&lt;/A&gt;ReadConsoleOutputCharacter&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;B&gt;ReadConsoleOutputCharacter&lt;/B&gt; function copies a number of characters from consecutive cells of a console screen buffer, beginning at a specified location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="syntax"&gt;&lt;B&gt;BOOL&lt;/B&gt; &lt;B&gt;ReadConsoleOutputCharacter(&lt;/B&gt;
  &lt;B&gt;HANDLE&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;hConsoleOutput&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPTSTR&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;lpCharacter&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;DWORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;nLength&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;COORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;dwReadCoord&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;,
&lt;/B&gt;  &lt;B&gt;LPDWORD&lt;/B&gt; &lt;I&gt;&lt;A class="synParam"&gt;&lt;SPAN style="text-decoration: underline;"&gt;lpNumberOfCharsRead&lt;/SPAN&gt;&lt;/A&gt;&lt;/I&gt;&lt;B&gt;&lt;/B&gt;&lt;B&gt;
&lt;/B&gt;&lt;B&gt;);&lt;/B&gt;
&lt;/PRE&gt;&lt;H4&gt;Parameters&lt;/H4&gt;&lt;DL&gt;&lt;DT&gt;&lt;I&gt;hConsoleOutput&lt;/I&gt; &lt;/DT&gt;&lt;DD&gt;[in] Handle to a console screen buffer. The handle must have the GENERIC_READ access right. For more information, see &lt;A href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.WIN32COM.v10.en/dllproc/base/console_buffer_security_and_access_rights.htm"&gt;&lt;SPAN style="text-decoration: underline;"&gt;Console Buffer Security and Access Rights&lt;/SPAN&gt;&lt;/A&gt;. &lt;/DD&gt;&lt;DT&gt;&lt;I&gt;lpCharacter&lt;/I&gt; &lt;/DT&gt;&lt;DD&gt;[out] Pointer to a buffer that receives the characters read from the console screen buffer. The total size required will be less than 64K. &lt;/DD&gt;&lt;DT&gt;&lt;I&gt;nLength&lt;/I&gt; &lt;/DT&gt;&lt;DD&gt;[in] Number of screen buffer character cells from which to read. The size of the buffer pointed to by the &lt;I&gt;lpCharacter&lt;/I&gt; parameter should be &lt;CODE&gt;nLength * sizeof(TCHAR)&lt;/CODE&gt;. &lt;/DD&gt;&lt;DT&gt;&lt;I&gt;dwReadCoord&lt;/I&gt; &lt;/DT&gt;&lt;DD&gt;[in] Coordinates of the first cell in the console screen buffer from which to read, in characters. The &lt;B&gt;X&lt;/B&gt; member of the &lt;A href="ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.WIN32COM.v10.en/dllproc/base/coord_str.htm"&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;COORD&lt;/SPAN&gt;&lt;/B&gt;&lt;/A&gt; structure is the column, and the &lt;B&gt;Y&lt;/B&gt; member is the row. &lt;/DD&gt;&lt;DT&gt;&lt;I&gt;lpNumberOfCharsRead&lt;/I&gt; &lt;/DT&gt;&lt;DD&gt;[out] Pointer to a variable that receives the number of characters actually read. &lt;/DD&gt;&lt;/DL&gt;&lt;H4&gt;Return Values&lt;/H4&gt;&lt;P&gt;If the function succeeds, the return value is nonzero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the function fails, the return value is zero. To get extended error information, call &lt;LINK errorurl="../common/badjump.htm" keywords="base.getlasterror" tabindex="0"&gt;&lt;B&gt;GetLastError&lt;/B&gt;&lt;/LINK&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;Remarks&lt;/H4&gt;&lt;P&gt;If the number of characters to be read from extends beyond the end of the specified screen buffer row, characters are read from the next row. If the number of characters to be read from extends beyond the end of the console screen buffer, characters up to the end of the console screen buffer are read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 05 Nov 2010 19:11:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793155#M33700</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2010-11-05T19:11:05Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793156#M33701</link>
      <description>I should add that the characters to be read, must actually reside in the console output window.&lt;BR /&gt;&lt;BR /&gt;IOW if FORTAN has the data buffered for eventual output, the read will not retrieve that which is not yet written.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 05 Nov 2010 19:13:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793156#M33701</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2010-11-05T19:13:52Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793157#M33702</link>
      <description>Thanks Steve and Jim. I will try Jim's suggestion.&lt;BR /&gt;&lt;BR /&gt;Olivier</description>
      <pubDate>Fri, 05 Nov 2010 20:55:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793157#M33702</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2010-11-05T20:55:16Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793158#M33703</link>
      <description>I have tested this code using IVF and it works for me.&lt;BR /&gt;&lt;BR /&gt;Integer Function LastConsoleLine(consolechars)&lt;BR /&gt;!&lt;BR /&gt;! Obtains the location of the console cursor from the ConsoleScreenBufferInfo&lt;BR /&gt;! structure populated by a call to GetConsoleScreenBufferInfo&lt;BR /&gt;! Then uses the present location of the cursor (row and column values in a T_COORD structure)&lt;BR /&gt;! to obtain the contents of the previous row using ReadConsoleOutputCharacter, &lt;BR /&gt;! reading up to 80 characters and placing them into variable CONSOLECHARS. &lt;BR /&gt;! The function returns CONSOLECHARS and its length minus any trailing blanks.&lt;BR /&gt;!&lt;BR /&gt; use dfwin&lt;BR /&gt; use dfwinty&lt;BR /&gt;&lt;BR /&gt; implicit none&lt;BR /&gt; integer lconsoleline, nconsolechars, hconsole, lret&lt;BR /&gt; type (T_COORD) coord&lt;BR /&gt; type (T_CONSOLE_SCREEN_BUFFER_INFO) consoleinfo&lt;BR /&gt; ! This structure contains&lt;BR /&gt; ! TYPE (T_COORD) dwSize &lt;BR /&gt; ! TYPE (T_COORD) dwCursorPosition ! THIS GIVES THE CURSOR POSITION THAT IS WANTED &lt;BR /&gt; ! integer(WORD) wAttributes &lt;BR /&gt; ! TYPE (T_SMALL_RECT) srWindow &lt;BR /&gt; ! TYPE (T_COORD) dwMaximumWindowSize &lt;BR /&gt;&lt;BR /&gt; character(80) consolechars&lt;BR /&gt; &lt;BR /&gt; hconsole=GetStdHandle(STD_OUTPUT_HANDLE)&lt;BR /&gt; ! Get the console information &lt;BR /&gt; lret=GetConsoleScreenBufferInfo(hconsole,consoleinfo)&lt;BR /&gt; ! Step back one row and start reading at column 1&lt;BR /&gt; coord%y=consoleinfo%dwcursorposition%y-1&lt;BR /&gt; coord%x=1&lt;BR /&gt; lret=ReadConsoleOutputCharacter(hconsole,consolechars,80,coord,LOC(nconsolechars))&lt;BR /&gt; lconsoleline=LEN_TRIM(consolechars)&lt;BR /&gt; !  print *,'Last Console line contents = ',TRIM(consolechars)&lt;BR /&gt; !  print *,'Last Console line length (minus trailing blanks)= ',lconsoleline&lt;BR /&gt; LastConsoleLine=lconsoleline&lt;BR /&gt; !&lt;BR /&gt; ! If return value = 0, last line was all blanks&lt;BR /&gt;end Function</description>
      <pubDate>Tue, 09 Nov 2010 15:17:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793158#M33703</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-09T15:17:13Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793159#M33704</link>
      <description>Great post Anthony!&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Tue, 09 Nov 2010 15:35:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793159#M33704</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2010-11-09T15:35:43Z</dc:date>
    </item>
    <item>
      <title>Is it possible to read the last line written on the console?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793160#M33705</link>
      <description>You're welcome!</description>
      <pubDate>Wed, 10 Nov 2010 11:15:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Is-it-possible-to-read-the-last-line-written-on-the-console/m-p/793160#M33705</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-10T11:15:47Z</dc:date>
    </item>
  </channel>
</rss>

