<?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: Character Count Editing (Q) in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909969#M83168</link>
    <description>&lt;DIV style="margin:0px;"&gt;Thank you, Paul Curtis. This piece of code will work!&lt;BR /&gt;&lt;BR /&gt;And Steve, although they may have the same meaning, theyare different. Notice that if you compile the same example changing only CHARACTER(80) to CHARACTER*80, it won't work. Besides,put a new variable in the test program and debug it. You will notice that one is an array of chars, the other is a string. Again, they may seen the same, yet they are different.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Roger&lt;BR /&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 19 Oct 2009 10:42:19 GMT</pubDate>
    <dc:creator>rogcar</dc:creator>
    <dc:date>2009-10-19T10:42:19Z</dc:date>
    <item>
      <title>Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909961#M83160</link>
      <description>Hello there,&lt;BR /&gt;&lt;BR /&gt;I tried to use the Q character count in a format sentence, and it's giving a runtime input conversion error. The error alsohappens withthe example given in the help. I'm using v11.1.046. The following example was extracted from the help:&lt;BR /&gt;&lt;BR /&gt;Assume the file Q.DAT contains:&lt;BR /&gt;&lt;BR /&gt;1234.567Hello&lt;BR /&gt;&lt;BR /&gt;The following program reads in the number REAL1, determines the characters left in the record, and reads those into STR:&lt;BR /&gt;&lt;BR /&gt;CHARACTER STR(80)&lt;BR /&gt;INTEGER LENGTH&lt;BR /&gt;REAL REAL1&lt;BR /&gt;OPEN (UNIT = 10, FILE = 'Q.DAT')&lt;BR /&gt;100 FORMAT (F8.3, Q, 80A1)&lt;BR /&gt;READ (10, 100) REAL1, LENGTH, (STR(I), I=1, LENGTH)&lt;BR /&gt;PRINT * , str&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;Any guess?&lt;BR /&gt;Regards,&lt;BR /&gt;Roger</description>
      <pubDate>Fri, 16 Oct 2009 12:38:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909961#M83160</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-16T12:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909962#M83161</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Roger,&lt;BR /&gt;&lt;BR /&gt;What happens when you read just the F8.3 REAL1 (using same file, but different FORMAT and READ)?&lt;BR /&gt;If no error, what is the value of REAL1?&lt;BR /&gt;or&lt;BR /&gt;If this produces conversion error, then read line into STR using 80A1. Is there junk in the line?&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 16 Oct 2009 12:48:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909962#M83161</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-10-16T12:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909963#M83162</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hello Jim&lt;BR /&gt;&lt;BR /&gt;If I read just the REAL1, using F8.3, it gives the correct value: 1234.567. If I use something different (like F9.3), it will give an error, since the number has 8 chars. I was trying to find the error here, but I realize that it is not a Q problem, but a format problem. I'm still trying and now I could get this example to work. It was an typing error (I wrote 1234,567 &amp;lt;- notice the comma).&lt;BR /&gt;&lt;BR /&gt;Nevertheless, I still trying to use the format thing in the read statement, and having some problems. I'll try to explain:&lt;BR /&gt;Lets say that I need to read the following three lines:&lt;BR /&gt;123 testing line 1&lt;BR /&gt;12 testing line 2&lt;BR /&gt;1 testing line 3&lt;BR /&gt;&lt;BR /&gt;How can I read the first number (an integer) and the rest put into a char? If I use a FORMAT, like "10 FORMAT (I3,80A1)" and then read the text, the third line will give me an error (since the read integer will be "1 t"). If I use a unformatted read (*), I get the correct number, but the string gives only "testing". Do you know any workaround?&lt;BR /&gt;&lt;BR /&gt;I hope I was able to explain...&lt;BR /&gt;Thanks for your kind help&lt;BR /&gt;Roger&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Oct 2009 13:34:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909963#M83162</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-16T13:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909964#M83163</link>
      <description>&lt;DIV style="margin:0px;"&gt;I found the answer. Two rules apply: If I use a formated input, it must have the correct size. That means I cannot use the formated read. The second rules says that,if using the unformated read, whenever a blank character is found, the character string read is stoped.&lt;BR /&gt;&lt;BR /&gt;Well, the only work around is to create a function to determine the value of the size using a formated input, but that would slow down the reading process.&lt;BR /&gt;&lt;BR /&gt;If someone knowsother way, I'd appreciate your kind suggestion.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Roger&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Oct 2009 14:08:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909964#M83163</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-16T14:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909965#M83164</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Why are you using 80A1 rather than A (or A80)? 80A1 isn't what you want when reading a CHARACTER(80) variable.&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Oct 2009 15:15:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909965#M83164</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-16T15:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909966#M83165</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/336209"&gt;Steve Lionel (Intel)&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 are you using 80A1 rather than A (or A80)? 80A1 isn't what you want when reading a CHARACTER(80) variable.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Actually, I using an example given by the help files. Notice that it is CHARACTER(80), instead of CHARACTER*80. The first is an array of chars, the second is a string. It may seen silly, but they are different. If you declare a CHARACTER(2)*80 you are declaring an array of 2 string, each with 80 positions. But if you declare CHARACTER(80)*2 you are declaring 80 strings 2 character long. So, if you use 80A1, the format specifies 80 characters, but if you use A80, it is a string 80 characters long.&lt;BR /&gt;&lt;BR /&gt;Weird, hum! Anyway, it was just a copy and paste :). Ow, in the example, it is 80A1, as the variable was declared as CHARACTER(80). Nevertheless, I still have to read unformated text in a formated fashion... Any ideas?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Roger</description>
      <pubDate>Fri, 16 Oct 2009 16:24:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909966#M83165</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-16T16:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909967#M83166</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;CHARACTER(80) and CHARACTER*80 have the same meaning.&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Oct 2009 17:34:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909967#M83166</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-16T17:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909968#M83167</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/444803"&gt;rogcar&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; 123 testing line 1&lt;BR /&gt;12 testing line 2&lt;BR /&gt;1 testing line 3&lt;BR /&gt;&lt;BR /&gt;How can I read the first number (an integer) and the rest put into a char? &lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;PRE&gt;[cpp]INTEGER  :: ival, nc&lt;BR /&gt;CHARACTER(LEN=40)  :: string&lt;BR /&gt;&lt;BR /&gt;OPEN (3, FILE=somefile, STATUS='OLD')&lt;BR /&gt;READ (3, '(A)') string&lt;BR /&gt;&lt;BR /&gt;!  first blank delimits integer field&lt;BR /&gt;nc = INDEX(string, ' ') - 1&lt;BR /&gt;IF (nc &amp;gt;= 1) THEN&lt;BR /&gt;  READ (string(1:nc), '(I)') ival&lt;BR /&gt;  &lt;BR /&gt;  !  left-pack the rest of the string&lt;BR /&gt;  string = string(nc+2:)&lt;BR /&gt;&lt;BR /&gt;!  input error&lt;BR /&gt;ELSE&lt;BR /&gt;  !&lt;BR /&gt;END IF[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Oct 2009 23:45:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909968#M83167</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2009-10-16T23:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909969#M83168</link>
      <description>&lt;DIV style="margin:0px;"&gt;Thank you, Paul Curtis. This piece of code will work!&lt;BR /&gt;&lt;BR /&gt;And Steve, although they may have the same meaning, theyare different. Notice that if you compile the same example changing only CHARACTER(80) to CHARACTER*80, it won't work. Besides,put a new variable in the test program and debug it. You will notice that one is an array of chars, the other is a string. Again, they may seen the same, yet they are different.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Roger&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Oct 2009 10:42:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909969#M83168</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-19T10:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909970#M83169</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;What you have in the initial example is:&lt;BR /&gt;&lt;BR /&gt;CHARACTER STR(80)&lt;BR /&gt;&lt;BR /&gt;That is indeed an array of 80 single characters. What I referred to would be:&lt;BR /&gt;&lt;BR /&gt;CHARACTER(80) STR&lt;BR /&gt;&lt;BR /&gt;I apologize for not making this clear.&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 13:02:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909970#M83169</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-19T13:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909971#M83170</link>
      <description>&lt;DIV style="margin:0px;"&gt;Ow, I see. Now I realize that I also haven't been clear myself. I also apologize, for Idid not understand what you said before. Putting that way,I do agree with you.By the way, after re-reading my last post,I may have sound rude, butI didn't want to. That was not what I meant. Sorry.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Roger&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Oct 2009 13:36:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909971#M83170</guid>
      <dc:creator>rogcar</dc:creator>
      <dc:date>2009-10-19T13:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Character Count Editing (Q)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909972#M83171</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
I didn't think you were rude.&lt;BR /&gt;&lt;BR /&gt;Looking at the original example, I can see it is confusing. It is almost prehistoric, I think, but it does illustrate the feature. Maybe I will be able to think of a better way to show it off.&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2009 14:47:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Character-Count-Editing-Q/m-p/909972#M83171</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-10-19T14:47:02Z</dc:date>
    </item>
  </channel>
</rss>

