<?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 comparison strangeness in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957987#M21223</link>
    <description>Standard Fortran behavior.  When you compare strings of unequal lengths, the shorter string is padded on the right with blanks as necessary.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Thu, 12 Jul 2001 01:20:35 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2001-07-12T01:20:35Z</dc:date>
    <item>
      <title>Character comparison strangeness</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957986#M21222</link>
      <description>Hi &lt;BR /&gt; &lt;BR /&gt;I am somewhat baffled by this behaviour. I have this program &lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="+0"&gt;&lt;PRE&gt;
PROGRAM LoadOfRubbish 
 
INTERFACE 
  SUBROUTINE IsAnything( NAME) 
    CHARACTER(LEN=*), OPTIONAL :: NAME 
  END SUBROUTINE 
END INTERFACE 
 
CALL IsAnything( NAME = '--------' ) 
CALL IsAnything( NAME = '        ' ) 
CALL IsAnything( NAME = '' ) 
 
END 
 
SUBROUTINE IsAnything ( NAME ) 
 
CHARACTER(LEN=*), OPTIONAL :: NAME 
 
IF(PRESENT(NAME)) THEN 
  WRITE(*,'(A)') NAME 
  WRITE(*,*) LEN(NAME) 
  IF(NAME .EQ. '') WRITE(*,*) 'WOOPS' 
END IF 
 
RETURN 
 
END 
 
When I run it I get the following output 
 
-------- 
 8 
         
 8 
 WOOPS 
 
 0 
 WOOPS 
&lt;/PRE&gt;&lt;/FONT&gt;&lt;BR /&gt;It seems that the string '        ' (8 spaces) is being incorrectly &lt;BR /&gt;flagged as being equal to '' (NULL string) &lt;BR /&gt;I am completely baffled by this!! &lt;BR /&gt; &lt;BR /&gt;Any insight would be most welcome &lt;BR /&gt; &lt;BR /&gt;Geoff</description>
      <pubDate>Thu, 12 Jul 2001 00:50:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957986#M21222</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-07-12T00:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison strangeness</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957987#M21223</link>
      <description>Standard Fortran behavior.  When you compare strings of unequal lengths, the shorter string is padded on the right with blanks as necessary.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 12 Jul 2001 01:20:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957987#M21223</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-07-12T01:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison strangeness</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957988#M21224</link>
      <description>Steve &lt;BR /&gt; &lt;BR /&gt;Thanks. Sorry to waste your time. &lt;BR /&gt; &lt;BR /&gt;Geoff</description>
      <pubDate>Thu, 12 Jul 2001 17:55:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-comparison-strangeness/m-p/957988#M21224</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-07-12T17:55:34Z</dc:date>
    </item>
  </channel>
</rss>

