<?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: Detect empty string / variable? in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933681#M15397</link>
    <description>"Sailil" has been deleted.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Thu, 04 Jan 2001 02:36:31 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2001-01-04T02:36:31Z</dc:date>
    <item>
      <title>Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933675#M15391</link>
      <description>Greetings all.  I want to perform some sort of logical test on a variable to determine if it's empty (or null value or the like).  In MATLAB, it would be isempty(), but FORTRAN is not very forthcoming. &lt;BR /&gt; &lt;BR /&gt;I'm very familiar with FORTRAN, but searches through help pdf-s haven't turned up anything I can use.  Thanks in advance! &lt;BR /&gt;-Sailil</description>
      <pubDate>Wed, 03 Jan 2001 07:08:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933675#M15391</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-01-03T07:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933676#M15392</link>
      <description>What exactly do you mean by "empty"?  Fortran doesn't have the concept.  The closest you can come is with a POINTER or ALLOCATABLE variable by asking if it is ASSOCIATED, but I can't figure out what "empty" would mean in general.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 03 Jan 2001 08:04:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933676#M15392</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-01-03T08:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933677#M15393</link>
      <description>Variables in Fortran only have a value, with the exception of NULL for Pointers, Allocated() for Allocatable arrays and LenTrim()==0 for Strings. &lt;BR /&gt; &lt;BR /&gt;What you want to do is associate a property with other types of variables that convey specific information. There elegant methods, including defining more complex data types in Fortran 90, which will accomplish this. &lt;BR /&gt; &lt;BR /&gt;However, the way I have done this forever is to identify ranges of the variable which are not valid for the problem at hand &lt;BR /&gt;eg., negative numbers for Temperature or negative values for "number of samples" &lt;BR /&gt; &lt;BR /&gt;Define your own set of codes that occupy this "invalid" range and test for the presence of these values.   &lt;BR /&gt; &lt;BR /&gt;Of course, if the variables have no invalid range, you have a problem and associating logical variables may be the only solution.</description>
      <pubDate>Wed, 03 Jan 2001 10:07:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933677#M15393</guid>
      <dc:creator>cfrieler</dc:creator>
      <dc:date>2001-01-03T10:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933678#M15394</link>
      <description>Variables in Fortran only have a value, with the exception of NULL for Pointers, Allocated() for Allocatable arrays and LenTrim()==0 for Strings.  &lt;BR /&gt;  &lt;BR /&gt;What you want to do is associate a property that conveys specific information with other types of variables. There are elegant methods, including defining more complex data types in Fortran 90, which will accomplish this. For example; &lt;BR /&gt; &lt;BR /&gt;Type Scatter_Matrix &lt;BR /&gt;     Logical (4)     Initialized &lt;BR /&gt;     Real    (8)     Cross_Section(:) &lt;BR /&gt;   End Type &lt;BR /&gt;  &lt;BR /&gt;However, the way I have done this forever is to identify ranges of the variable which are not valid for the problem at hand  &lt;BR /&gt;eg., negative numbers for Temperature or negative values for "number of samples"  &lt;BR /&gt;Define your own set of codes that occupy this "invalid" range and test for the presence of these values.  &lt;BR /&gt; &lt;BR /&gt;If ( Cross Section(1) == -1.d30 ) then  ! =&amp;gt; not initialized &lt;BR /&gt;   ... &lt;BR /&gt;  EndIf &lt;BR /&gt; &lt;BR /&gt;Of course, they now caution you about using "==" with real numbers, so a better implementation might be &lt;BR /&gt; &lt;BR /&gt;Logical (4)     Test &lt;BR /&gt;  Test = abs(Cross_Section(1) + 1.d30) &amp;lt; 1.d16 &lt;BR /&gt;If ( Test ) then      ! =&amp;gt; not initialized &lt;BR /&gt;   ... &lt;BR /&gt;  EndIf &lt;BR /&gt;  &lt;BR /&gt;If the variables have no invalid range, you have a problem and associating logical variables, possibly through defined type, may be the only solution.</description>
      <pubDate>Wed, 03 Jan 2001 10:09:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933678#M15394</guid>
      <dc:creator>cfrieler</dc:creator>
      <dc:date>2001-01-03T10:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933679#M15395</link>
      <description>As it happens, I am using strings in this case so I can use LEN_TRIM(), but I was hoping for a more robust detector.  I'm implementing error checking in my subroutines, such that I want to make sure something is there before I start manipulating it.  I want to know if a variable has a value (and equaling zero counts as having a value).  In Matlab, I've made a habit of nargin and nargout-ing everywhere, along with isexist() and isempty().  If Fortran doesn't have such a creature, then I'll have to do without.  For now, though, LEN_TRIM does what I'm looking for. &lt;BR /&gt; &lt;BR /&gt;Thanks for all the help!! &lt;BR /&gt;Sailil &lt;BR /&gt; &lt;BR /&gt;ps.  To the forum administrator folk: Apparently this forum doesn't support the NOSPAM in emails.  Therefore the "Sailil" profile needs trashed.  Since I put NOSPAM in my email address, I didn't get mailed a password.  And since I didn't get a password, I couldn't login as me.  Also couldn't create a new profile because I still existed, I suppose.  So if you can, get rid of "Sailil," I'll come back as my present "Saillil."  Thanks again</description>
      <pubDate>Thu, 04 Jan 2001 01:18:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933679#M15395</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-01-04T01:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933680#M15396</link>
      <description>Well, you can do something like:&lt;BR /&gt;&lt;P&gt;&lt;BR /&gt;IF (STRING == "") ...&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This will test whether the string is all blank (remember that Fortran CHARACTER variables are fixed-length.)&lt;BR /&gt;&lt;BR /&gt;Fortran does have a PRESENT intrinsic for use with OPTIONAL arguments (explicit interface is required when calling - see my Doctor Fortran article in the latest Visual Fortran newsletter (when the web server comes back up, that is!)&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2001 02:15:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933680#M15396</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-01-04T02:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Detect empty string / variable?</title>
      <link>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933681#M15397</link>
      <description>"Sailil" has been deleted.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 04 Jan 2001 02:36:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Detect-empty-string-variable/m-p/933681#M15397</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-01-04T02:36:31Z</dc:date>
    </item>
  </channel>
</rss>

