<?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 and integer manipulation in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Character-and-integer-manipulation/m-p/954995#M20583</link>
    <description>Two points on this, firstly that you need 8-character strings to write 'Thk_1001', and secondly unless you insert lead zeros, your strings will not sort - the latter point may not matter to you. &lt;BR /&gt; &lt;BR /&gt;I have forgotten (again!) the magic characters to make source code readable on this message board*, but try this: &lt;BR /&gt; &lt;BR /&gt;CHARACTER*8 B(1001) &lt;BR /&gt;INTEGER I &lt;BR /&gt; &lt;BR /&gt;B = 'Thk_' &lt;BR /&gt;DO I= 1,1001 &lt;BR /&gt;  WRITE (B(I)(5:8),'(I4.4)') I &lt;BR /&gt;END DO &lt;BR /&gt; &lt;BR /&gt;The result is typically B(14) = 'Thk_0014' &lt;BR /&gt; &lt;BR /&gt;Bear of little brain &lt;BR /&gt; &lt;BR /&gt;*Steve, please could we have a link to a reminder of the magic characters?</description>
    <pubDate>Tue, 19 Jun 2001 15:05:36 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-06-19T15:05:36Z</dc:date>
    <item>
      <title>Character and integer manipulation</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-and-integer-manipulation/m-p/954994#M20582</link>
      <description>I would like to create a set of characters as follows: &lt;BR /&gt;Thk_1, Thk_2, .........Thk_501,........ &lt;BR /&gt; &lt;BR /&gt;So I create a do loop as follows: &lt;BR /&gt; &lt;BR /&gt;Character(5) b &lt;BR /&gt;integer i &lt;BR /&gt; &lt;BR /&gt;OuterLoop: do i = 1,1001 &lt;BR /&gt;    b = 'Thk_'//i &lt;BR /&gt;Enddo OuterLoop &lt;BR /&gt; &lt;BR /&gt;Obviously the above contruct gives errors since characters and integers cannot be mixed in the above operation. &lt;BR /&gt;My questions is how do i create such charcaters in a loop? &lt;BR /&gt; &lt;BR /&gt;thank you very much &lt;BR /&gt; &lt;BR /&gt;...animesh</description>
      <pubDate>Tue, 19 Jun 2001 05:58:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-and-integer-manipulation/m-p/954994#M20582</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-06-19T05:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Character and integer manipulation</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-and-integer-manipulation/m-p/954995#M20583</link>
      <description>Two points on this, firstly that you need 8-character strings to write 'Thk_1001', and secondly unless you insert lead zeros, your strings will not sort - the latter point may not matter to you. &lt;BR /&gt; &lt;BR /&gt;I have forgotten (again!) the magic characters to make source code readable on this message board*, but try this: &lt;BR /&gt; &lt;BR /&gt;CHARACTER*8 B(1001) &lt;BR /&gt;INTEGER I &lt;BR /&gt; &lt;BR /&gt;B = 'Thk_' &lt;BR /&gt;DO I= 1,1001 &lt;BR /&gt;  WRITE (B(I)(5:8),'(I4.4)') I &lt;BR /&gt;END DO &lt;BR /&gt; &lt;BR /&gt;The result is typically B(14) = 'Thk_0014' &lt;BR /&gt; &lt;BR /&gt;Bear of little brain &lt;BR /&gt; &lt;BR /&gt;*Steve, please could we have a link to a reminder of the magic characters?</description>
      <pubDate>Tue, 19 Jun 2001 15:05:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-and-integer-manipulation/m-p/954995#M20583</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-06-19T15:05:36Z</dc:date>
    </item>
  </channel>
</rss>

