<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:baron@caesar.elte.hu" title="Aron Budea <baron@caesar.elte.hu>"> <span class="fn">Aron Budea</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Regression on Basic Iif() function"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=136467">bug 136467</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Keywords</td>
           <td>bibisectRequest, regression
           </td>
           <td>bibisected, bisected
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>NOTABUG
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>baron@caesar.elte.hu
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Regression on Basic Iif() function"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=136467#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTABUG - Regression on Basic Iif() function"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=136467">bug 136467</a>
              from <span class="vcard"><a class="email" href="mailto:baron@caesar.elte.hu" title="Aron Budea <baron@caesar.elte.hu>"> <span class="fn">Aron Budea</span></a>
</span></b>
        <pre>(In reply to Alain Romedenne from <a href="show_bug.cgi?id=136467#c0">comment #0</a>)
<span class="quote">> Description:
> Iif(condition, expression1, expression2) evaluates BOTH expressions before
> execution. Exceptions can be raised unconditionnally.</span >
I don't think this is a regression. In fact, I don't think it's a bug, I
haven't found a reference to StarBasic, but VBA has the same function:
<a href="https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/iif-function">https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/iif-function</a>

This states:
"IIf always evaluates both truepart and falsepart, even though it returns only
one of them. Because of this, you should watch for undesirable side effects.
For example, if evaluating falsepart results in a division by zero error, an
error occurs even if expr is True."

Further note on the change that happened in 6.3:
<span class="quote">> e.g.
> Sub _inverse_
>    Print Iif(x=0,0,1/x)
> End Sub</span >
If you do it like this, there's been a division by zero in older versions as
well:
x=0
Print Iif(x=0,0,1/x)

The difference in the evaluation of the original sample came with the following
commit:
<a href="https://cgit.freedesktop.org/libreoffice/core/commit/?id=15c39bb2e75df40c30bcbf789d815376dd2e31ce">https://cgit.freedesktop.org/libreoffice/core/commit/?id=15c39bb2e75df40c30bcbf789d815376dd2e31ce</a>
author          Eike Rathke <<a href="mailto:erack@redhat.com">erack@redhat.com</a>>  2019-05-02 20:54:16 +0200
committer       Eike Rathke <<a href="mailto:erack@redhat.com">erack@redhat.com</a>>  2019-05-02 22:35:35 +0200

Resolves: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Empty Variant leads to the following operator being ignored"
   href="show_bug.cgi?id=124605">tdf#124605</a> ditch "if operand 1 is Empty, result is operand 2"</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>