<?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: How to extract real figures from a dialog control? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854324#M67010</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We use&lt;BR /&gt;read(string,*) x&lt;BR /&gt;to convert the number in string into the real number x. I dont know if this is good fortran programming style, but it works ;-)&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
    <pubDate>Tue, 04 Nov 2008 11:26:13 GMT</pubDate>
    <dc:creator>onkelhotte</dc:creator>
    <dc:date>2008-11-04T11:26:13Z</dc:date>
    <item>
      <title>How to extract real figures from a dialog control?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854323#M67009</link>
      <description>&lt;P&gt;I want my programto read a user-specified real number for example 3.1415 from a character*6 TVAR&lt;/P&gt;
&lt;P&gt;I use the control GetDlgItemText to read the textstring from the control, and everything is fine.&lt;/P&gt;
&lt;P&gt;The variables in question are decalered as Character*6 TVAR, and real*4 RDIG&lt;/P&gt;
&lt;P&gt;I then use the internal read:&lt;/P&gt;
&lt;P&gt;read(string,'(F6.4)',err=xx))RDIG ( the textstring TVAR looks like "3.1415")&lt;/P&gt;
&lt;P&gt;This read statement always fails, and I think it is the decimalpoint in the user-written textstring TVAR that&lt;/P&gt;
&lt;P&gt;causes the error. Can anyone tell me the reason for this, and,is there a better way to do this&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Reidar&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2008 11:09:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854323#M67009</guid>
      <dc:creator>reidar_tyssen</dc:creator>
      <dc:date>2008-11-04T11:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract real figures from a dialog control?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854324#M67010</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We use&lt;BR /&gt;read(string,*) x&lt;BR /&gt;to convert the number in string into the real number x. I dont know if this is good fortran programming style, but it works ;-)&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2008 11:26:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854324#M67010</guid>
      <dc:creator>onkelhotte</dc:creator>
      <dc:date>2008-11-04T11:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract real figures from a dialog control?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854325#M67011</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;I think that the read fail can be caused by the trailing char(0).&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Something like that can be safer
&lt;PRE&gt;[cpp]l=getdlgitemtext(...,loc(string))
read(string(1:l),*,iostat=ioerr) x[/cpp]&lt;/PRE&gt;
&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2008 11:54:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854325#M67011</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2008-11-04T11:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract real figures from a dialog control?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854326#M67012</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/182649"&gt;gvautier&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;P&gt;I think that the read fail can be caused by the trailing char(0).&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Indeed it is -- you have to be careful to convert between C-style and Fortran-style strings when doing Windows programming:&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]!C to Fortran
string = string(1 : index(string,char(0))-1)
!Fortran to C
string = trim(string)//char(0)[/cpp]&lt;/PRE&gt;
&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2008 12:03:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854326#M67012</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2008-11-04T12:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract real figures from a dialog control?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854327#M67013</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;I have a function to do that job&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[cpp]function cstring(string)
character*(*) string
character*(len_trim(string)+1) cstring

cstring=trim(string)//char(0)

end function
[/cpp]&lt;/PRE&gt;
&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2008 13:56:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-extract-real-figures-from-a-dialog-control/m-p/854327#M67013</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2008-11-04T13:56:29Z</dc:date>
    </item>
  </channel>
</rss>

