<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:mikekaganski@hotmail.com" title="Mike Kaganski <mikekaganski@hotmail.com>"> <span class="fn">Mike Kaganski</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - The program does not continue with 'Dim' or 'ReDim' following 'If' in one line statement."
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=133811">bug 133811</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;">OS</td>
           <td>Linux (All)
           </td>
           <td>All
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>andreas.heinisch@yahoo.de
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Hardware</td>
           <td>x86-64 (AMD64)
           </td>
           <td>All
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - The program does not continue with 'Dim' or 'ReDim' following 'If' in one line statement."
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=133811#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - The program does not continue with 'Dim' or 'ReDim' following 'If' in one line statement."
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=133811">bug 133811</a>
              from <span class="vcard"><a class="email" href="mailto:mikekaganski@hotmail.com" title="Mike Kaganski <mikekaganski@hotmail.com>"> <span class="fn">Mike Kaganski</span></a>
</span></b>
        <pre>This is not specific to one-line If. In the code of <a href="show_bug.cgi?id=133811#c0">comment 0</a>, Test_IfIsClosed
only tests the k variable that gets Dim'ed in "true" branch; but trying to
MsgBox j there instead of MsgBox k also gives the same "Variable not defined."
run-time error.

But I am unsure that the "Expected Results" from <a href="show_bug.cgi?id=133811#c0">comment 0</a> ("Dim or ReDim
should be executed") are correct. Dim is not a run-time operator - it is
compile-time instruction. It should, naturally, be effective regardless of
conditions; but in fact, the line

<span class="quote">> If False Then Dim i%</span >

should be syntax error (since it's equal to this *incomplete* run-time
instruction: "If False Then"). It *is* syntax error in, say, VBA (tested in
Excel 2016).

Alternatively, it should be tolerated in non-VBA mode (to keep backward
compatibility with strange StarBasic code using it?), and then the "Expected
Results" is OK (but should be made syntax error in "Option VBASupport 1" mode).</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>