Created attachment 151848 [details] Draw file containing the code also posted in the report (Heritage from StarOffice) A variable name name like myChoice_ is generally recognized correctly. Occurring as the last item of a command line it is not correctly parsed. It may wrongly be interpreted as the respective name without the underscore at the end. This may be related to the "feature" of using an isolated underscore at a line's end meaning "continued next line". This bug may also be related to bug#57307 Run the code below to reproduce the issue. Sub showTheIssue() Dim a_ As Long a_ = 1234 b = a_ Print b a = 55 b = a_ Print b b = a_ * 1 REM Also works with : b = (a_) Print b b = a_ REM Also works with anything clearly delimiting the line. Print b End Sub
Correction: I actually had tested with LibO V3.3, but had wrongly assumed "common heritage" then. Just tested with StarOffice V5.2. and it did NOT show the issue.
The bug is still living in V 7.2.0.4
The problem lies in [1], because LO makes two rounds in order to parse and generate the underlying code for the macro. It could be solved in the easy way (just add a whitespace in the code after the underscore) or the hard and clean way (check where the line does not terminate if an underscore follows) [1] https://opengrok.libreoffice.org/xref/core/basic/source/comp/scanner.cxx?r=ef38b9af#300
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/67c15910606575b862410179698f81e7a598aa44 tdf#125637 - Correctly hand names ending with an underscore It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Andreas Heinisch committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/e2e2262e35278a12e716fef3cd61145047ef8680 tdf#125637 - Correctly hand names ending with an underscore It will be available in 7.2.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Fix verfied with 7.2.3.2
(In reply to Wolfgang Jäger from comment #6) > Fix verfied with 7.2.3.2 Setting to VERIFIED then Thanks for checking