<?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: Using C-style Escape Sequence in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843615#M61584</link>
    <description>I have developed a solution along the lines that James suggests, and have used it successfully for several months.  I also wanted to halt the program using ESC, so my function for reading in a string and returning with the string and its length (the function value) is:&lt;BR /&gt;&lt;PRE&gt;
function ReadVarStr(VarStr)
! Reads in string Varstr entered from the keyboard and returns length of VarStr as value of function. 
use dflib, only: FocusQQ, GetActiveQQ, GetCharQQ, GetTextPosition, OutText,    &amp;amp;
                 rccoord, SetActiveQQ, SetTextPosition
character*(*), intent(inout) :: VarStr
integer*4 acw, i, l, ReadVarStr
character*1 key
TYPE (rccoord) textpos
acw = GetActiveQQ()
i   = SetActiveQQ(0)
i   = 1
do
  call GetTextPosition(textpos)
  key = GetCharQQ()
  l = ICHAR(key)
  if (l == 27) then               ! ESC.
    STOP
  else if (l == 13) then          ! Return.
    call SetTextPosition(textpos.row+1,1,textpos)
    EXIT
  else if (l == 8) then           ! Backspace.
    if (i &amp;gt; 1) then
      i = i-1
      VarStr(i:i) = ' '
      call SetTextPosition(textpos.row,textpos.col-1,textpos)
      call OutText(' ')
      call SetTextPosition(textpos.row,textpos.col-1,textpos)
    end if
  else if (l &amp;lt; 32 .OR. l &amp;gt; 126) then
    CYCLE
  else
    call OutText(key)
    VarStr(i:i) = key
    i = i+1
  end if
end do
ReadVarStr = i-1
acw = FocusQQ(acw)
return
end function ReadVarStr
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Alan</description>
    <pubDate>Mon, 01 Jul 2002 12:37:41 GMT</pubDate>
    <dc:creator>llynisa</dc:creator>
    <dc:date>2002-07-01T12:37:41Z</dc:date>
    <item>
      <title>Using C-style Escape Sequence</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843611#M61580</link>
      <description>I'm letting the user display characters to a Quickwin child window with &lt;B&gt;return = fputc(unit, character)&lt;/B&gt;. How can I get the cursor to move back when user hits the BACKSPACE key?&lt;BR /&gt;&lt;BR /&gt;I've tried using an escape sequnce &lt;B&gt;return = fputc(unit, "&amp;#8;"C)[&amp;#8;] without success.&lt;/B&gt;</description>
      <pubDate>Fri, 28 Jun 2002 23:01:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843611#M61580</guid>
      <dc:creator>richpauir</dc:creator>
      <dc:date>2002-06-28T23:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using C-style Escape Sequence</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843612#M61581</link>
      <description>Haven't used Quickwin but suspect sending a backspace character to a graphics window just adds an escape character symbol to your display, but will not delete the previous character as it would on a console.&lt;BR /&gt;&lt;BR /&gt;You could trap the character (as you are apparently doing now) and rather than sending to the Quickwin window, call the appropriate routines to erase the previous row/column character and place the cursor back in that position, or send a delete key to the window.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Sat, 29 Jun 2002 01:31:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843612#M61581</guid>
      <dc:creator>james1</dc:creator>
      <dc:date>2002-06-29T01:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using C-style Escape Sequence</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843613#M61582</link>
      <description>James,&lt;BR /&gt;I've thought of testing &lt;B&gt;character = getcharqq()&lt;/B&gt; for &lt;B&gt;(ichar(character) == 8)&lt;/B&gt; to detect the user pressing the BACKSPACE key before sending the character to the &lt;B&gt;fputc&lt;/B&gt; function.  However, I'm not sure how to back the cursor up to the previous position.  Any suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Richard</description>
      <pubDate>Sat, 29 Jun 2002 02:02:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843613#M61582</guid>
      <dc:creator>richpauir</dc:creator>
      <dc:date>2002-06-29T02:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using C-style Escape Sequence</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843614#M61583</link>
      <description>Perhaps something like GETTEXTPOSITION, calculate previous character row/col position, SETTEXTPOSITION, output a space, SETTEXTPOSITION again.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Sat, 29 Jun 2002 02:28:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843614#M61583</guid>
      <dc:creator>james1</dc:creator>
      <dc:date>2002-06-29T02:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using C-style Escape Sequence</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843615#M61584</link>
      <description>I have developed a solution along the lines that James suggests, and have used it successfully for several months.  I also wanted to halt the program using ESC, so my function for reading in a string and returning with the string and its length (the function value) is:&lt;BR /&gt;&lt;PRE&gt;
function ReadVarStr(VarStr)
! Reads in string Varstr entered from the keyboard and returns length of VarStr as value of function. 
use dflib, only: FocusQQ, GetActiveQQ, GetCharQQ, GetTextPosition, OutText,    &amp;amp;
                 rccoord, SetActiveQQ, SetTextPosition
character*(*), intent(inout) :: VarStr
integer*4 acw, i, l, ReadVarStr
character*1 key
TYPE (rccoord) textpos
acw = GetActiveQQ()
i   = SetActiveQQ(0)
i   = 1
do
  call GetTextPosition(textpos)
  key = GetCharQQ()
  l = ICHAR(key)
  if (l == 27) then               ! ESC.
    STOP
  else if (l == 13) then          ! Return.
    call SetTextPosition(textpos.row+1,1,textpos)
    EXIT
  else if (l == 8) then           ! Backspace.
    if (i &amp;gt; 1) then
      i = i-1
      VarStr(i:i) = ' '
      call SetTextPosition(textpos.row,textpos.col-1,textpos)
      call OutText(' ')
      call SetTextPosition(textpos.row,textpos.col-1,textpos)
    end if
  else if (l &amp;lt; 32 .OR. l &amp;gt; 126) then
    CYCLE
  else
    call OutText(key)
    VarStr(i:i) = key
    i = i+1
  end if
end do
ReadVarStr = i-1
acw = FocusQQ(acw)
return
end function ReadVarStr
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Alan</description>
      <pubDate>Mon, 01 Jul 2002 12:37:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-C-style-Escape-Sequence/m-p/843615#M61584</guid>
      <dc:creator>llynisa</dc:creator>
      <dc:date>2002-07-01T12:37:41Z</dc:date>
    </item>
  </channel>
</rss>

