<?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: Blue Prism unexpected OR, AND precedence in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57193#M11243</link>
    <description>As a side note, there is a &lt;A href="https://community.blueprism.com/innovate/ideas/viewidea?IdeationKey=266fad13-05e0-48c0-9ef2-d19e91293aaf" target="_blank" rel="noopener"&gt;suggestion in the idea portal&lt;/A&gt; to add short-circuited logical operators, if anyone wants to upvote it. I think it would be very useful to have AndAlso and OrElse in Blue Prism expressions.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nicholas Zejdlik&lt;BR /&gt;RPA Developer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 12 Apr 2021 17:51:00 GMT</pubDate>
    <dc:creator>NicholasZejdlik</dc:creator>
    <dc:date>2021-04-12T17:51:00Z</dc:date>
    <item>
      <title>Blue Prism unexpected OR, AND precedence</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57189#M11239</link>
      <description>&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;Please take a look at example below. Is there any reason why BP interprets this operation as False?&lt;/DIV&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;Is OR operator higher Precedence than AND in BP?&lt;/DIV&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17024.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/17178i3E43086899C90798/image-size/large?v=v2&amp;amp;px=999" role="button" title="17024.png" alt="17024.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Michal Plich&lt;BR /&gt;PD&lt;BR /&gt;Nordea&lt;BR /&gt;Europe/Oslo&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2021 12:36:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57189#M11239</guid>
      <dc:creator>MichalPlich2</dc:creator>
      <dc:date>2021-04-12T12:36:00Z</dc:date>
    </item>
    <item>
      <title>RE: Blue Prism unexpected OR, AND precedence</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57190#M11240</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/30064"&gt;@MichalPlich2&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to Microsoft, logical operators guarantee evaluation of their operands from left to right. However, they evaluate the smallest number of operands needed to determine the result of the expression. This is what's referred to as "short-circuit" evaluation. As a result, some operands of an expression may not be evaluated. Further, the&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;logical &lt;SPAN&gt;AND operator has higher&amp;nbsp;&lt;/SPAN&gt;precedence&lt;SPAN&gt;&amp;nbsp;than the&amp;nbsp;&lt;/SPAN&gt;logical &lt;SPAN&gt;OR operator.&lt;BR /&gt;&lt;BR /&gt;Now, if you wrapped this equation as (1=2 AND 2=2) OR (2=2) then you'd see a True result.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Partner Integrations for Digital Exchange&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2021 14:23:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57190#M11240</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-04-12T14:23:00Z</dc:date>
    </item>
    <item>
      <title>RE: Blue Prism unexpected OR, AND precedence</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57191#M11241</link>
      <description>I am splitting hairs with this, but my nerd light turned on my head so I couldn't help myself. The result of what you described is absolutely right, and I'd say it's important to always use parentheses to ensure the order of operations is exactly as intended. I'm purely responding because it's interesting and this has caused me to learn something. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I don't think Blue Prism's expression syntax uses short circuit, since there's no support for AndAlso. Of course, I'm making the assumption that Blue Prism's Expression Syntax is directly based on VB.NET rather than it being abstracted/overridden with a different implementation. In Michal's example, I believe it's the operator precedence (which you mentioned) that causes his expression to evaluate to False.&lt;BR /&gt;&lt;BR /&gt;In Blue Prism expressions, it would seem that this:&lt;BR /&gt;1=2 AND 1=1 OR 2=2&lt;BR /&gt;is equal to this:&lt;BR /&gt;(1=2) AND (1=1 OR 2=2)&lt;BR /&gt;&lt;BR /&gt;Because AND has higher precedence (which of course I know you pointed out, so nothing new here), we can flip it around, and these expressions also evaluate to False:&lt;BR /&gt;1=1 OR 2=2 AND 1=2&lt;BR /&gt;(1=1 OR 2=2) AND (1=2)&lt;BR /&gt;&lt;BR /&gt;And I think this is a good example that results in True showing that AND takes precedence:&lt;BR /&gt;1=1 OR 1=2 AND 2=2&lt;BR /&gt;&lt;BR /&gt;If OR and AND were equal in precedence then this expression would result in True but instead it results in False:&lt;BR /&gt;1=1 OR 1=2 AND 2=3&lt;BR /&gt;But the only way to get True on that is to force the order of operations:&lt;BR /&gt;(1=1) OR (1=2 AND 2=3)&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Dave Morris&lt;BR /&gt;Cano Ai&lt;BR /&gt;Atlanta, GA&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2021 16:21:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57191#M11241</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2021-04-12T16:21:00Z</dc:date>
    </item>
    <item>
      <title>RE: Blue Prism unexpected OR, AND precedence</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57192#M11242</link>
      <description>Good point about the lack of &lt;STRONG&gt;AndAlso&lt;/STRONG&gt; and &lt;STRONG&gt;OrElse&lt;/STRONG&gt; operators in Blue Prism &lt;A class="user-content-mention" data-sign="@" data-contactkey="ae9fdab1-2d26-46c7-9f20-a84e446d45c9" data-tag-text="@Dave Morris" href="https://community.blueprism.com/network/profile?UserKey=ae9fdab1-2d26-46c7-9f20-a84e446d45c9" data-itemmentionkey="188b0ee9-34da-46b5-be5c-2f9c8d19840d"&gt;@Dave Morris&lt;/A&gt;. I'd say you are correct about the lack of short-circuit evaluation w/o them. That's what I get for overlaying my C# bias. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Partner Integrations for Digital Exchange&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2021 16:58:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57192#M11242</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-04-12T16:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Blue Prism unexpected OR, AND precedence</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57193#M11243</link>
      <description>As a side note, there is a &lt;A href="https://community.blueprism.com/innovate/ideas/viewidea?IdeationKey=266fad13-05e0-48c0-9ef2-d19e91293aaf" target="_blank" rel="noopener"&gt;suggestion in the idea portal&lt;/A&gt; to add short-circuited logical operators, if anyone wants to upvote it. I think it would be very useful to have AndAlso and OrElse in Blue Prism expressions.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Nicholas Zejdlik&lt;BR /&gt;RPA Developer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2021 17:51:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57193#M11243</guid>
      <dc:creator>NicholasZejdlik</dc:creator>
      <dc:date>2021-04-12T17:51:00Z</dc:date>
    </item>
    <item>
      <title>RE: Blue Prism unexpected OR, AND precedence</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57194#M11244</link>
      <description>I voted for it just now. That kind of functionality would go well with If statement support in Expressions as well.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Dave Morris&lt;BR /&gt;Cano Ai&lt;BR /&gt;Atlanta, GA&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Apr 2021 19:12:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Blue-Prism-unexpected-OR-AND-precedence/m-p/57194#M11244</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2021-04-12T19:12:00Z</dc:date>
    </item>
  </channel>
</rss>

