[Libreoffice-bugs] [Bug 133811] The program does not continue with 'Dim' or 'ReDim' following 'If' in one line statement.

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Jun 9 08:38:15 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=133811

Mike Kaganski <mikekaganski at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Linux (All)                 |All
                 CC|                            |andreas.heinisch at yahoo.de
           Hardware|x86-64 (AMD64)              |All

--- Comment #1 from Mike Kaganski <mikekaganski at hotmail.com> ---
This is not specific to one-line If. In the code of comment 0, 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 comment 0 ("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

> If False Then Dim i%

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).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200609/81ddb50b/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list