<?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: If Exist or If Not Exist in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606804#M185610</link>
    <description>&lt;P&gt;Thank you everybody for the support.&amp;nbsp; I have made the change to the code snippet,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The decision is made in a program which is represented by "Variable Not..."and "Variable..."&amp;nbsp; Each one will replaced by several lines of code.&lt;/P&gt;
&lt;P&gt;Again,&amp;nbsp; Thank you&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2019 22:45:55 GMT</pubDate>
    <dc:creator>tietjee</dc:creator>
    <dc:date>2019-04-21T22:45:55Z</dc:date>
    <item>
      <title>If Exist or If Not Exist</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606767#M185600</link>
      <description>&lt;P&gt;I am writing a program and would like to use an if statement&amp;nbsp; with the following format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if X exist&lt;/P&gt;
&lt;P&gt;if X does not exist&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running Prime 5. I did not see this as an option in the help files.&lt;/P&gt;
&lt;P&gt;Mathcad 15 does not appear to have the feature either&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2019 23:06:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606767#M185600</guid>
      <dc:creator>tietjee</dc:creator>
      <dc:date>2019-04-20T23:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: If Exist or If Not Exist</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606768#M185601</link>
      <description>&lt;P&gt;Solved my own question.&amp;nbsp; It is not as clean as other programming languages.&amp;nbsp; Attached is my solution, which will work for my application.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 00:15:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606768#M185601</guid>
      <dc:creator>tietjee</dc:creator>
      <dc:date>2019-04-21T00:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: If Exist or If Not Exist</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606773#M185604</link>
      <description>&lt;P&gt;Mathcad has a (non-programming, so it works even in Express) if statement like the one in EXCEL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if(boolean test, result if true, result if false)&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 06:06:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606773#M185604</guid>
      <dc:creator>Fred_Kohlhepp</dc:creator>
      <dc:date>2019-04-21T06:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: If Exist or If Not Exist</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606784#M185606</link>
      <description>&lt;P&gt;Try please the try operator!&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 08:28:57 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606784#M185606</guid>
      <dc:creator>ValeryOchkov</dc:creator>
      <dc:date>2019-04-21T08:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: If Exist or If Not Exist</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606786#M185607</link>
      <description>&lt;P&gt;As you already noticed there is unfortunately no way to check if a variable is already defined.&lt;BR /&gt;You would have to write a program which saves the worksheet and scans the xml-file in the saved archive (a mcdx-file is just a renamed zip archive) for the existence of a variable definition.&lt;/P&gt;
&lt;P&gt;Also Valerys suggestion does not help as Prime would reject the call to the function if you provide an undefined variable as argument and the function so would be never called.&lt;/P&gt;
&lt;P&gt;But if just checking if a (defined) variable has the "value" NaN is enough, your solution can be simplified a little bit by omitting the local variable y. Furthermore you could follow Freds advice to use the if-function instead of the programming if-statement. This has the benefit that the routine will also work in the limited Prime Express. The definition will be shorter that way, but also a little bit less clear.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="B.png" style="width: 516px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/15936i0F6B5E422E27C63A/image-dimensions/516x184?v=v2" width="516" height="184" role="button" title="B.png" alt="B.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 15:52:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606786#M185607</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2019-04-21T15:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: If Exist or If Not Exist</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606804#M185610</link>
      <description>&lt;P&gt;Thank you everybody for the support.&amp;nbsp; I have made the change to the code snippet,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The decision is made in a program which is represented by "Variable Not..."and "Variable..."&amp;nbsp; Each one will replaced by several lines of code.&lt;/P&gt;
&lt;P&gt;Again,&amp;nbsp; Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 22:45:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/If-Exist-or-If-Not-Exist/m-p/606804#M185610</guid>
      <dc:creator>tietjee</dc:creator>
      <dc:date>2019-04-21T22:45:55Z</dc:date>
    </item>
  </channel>
</rss>

