Apache OpenOffice (AOO) Bugzilla – Issue 77338
2 or more numerical labels cause compile error in OpenOffice.org Basic
Last modified: 2017-05-20 10:47:44 UTC
Steps to reproduce the behaviour in OOo-dev 2.2.0: 1) Start an OpenOffice.org application (eg Writer or Calc). 2) Open the OOo-dev Basic Macros dialog (Tools/Macros/Organize Macros/OOo-dev Basic). 3) Create a new macro in the new document. 4) Create a new module in the new document. 5) Edit the Main macro of this module in the macro editor so that it looks like this: Sub Main 1: 2: End Sub 6) Try to compile or run the sub (or just close the Basic window and open it again). 7) A message box with the following error message appears: BASIC syntax error. Label $(ARG1) already defined. The behaviour could be reproduced in: i) OOo-dev 2.2.0 ii) OOo 2.2 FSF.hu Build 2 iii) OOo 2.1 FSF.hu The error message in the Hungarian builds (only included here to aid Hungarian searches): BASIC szintaktikai hiba. A cÃmke már létezik $(ARG1). Remarks 1) One numerical label (with or without further non-numerical labels) doesn't cause the error. 2) More code doesn't seem to prevent the error. 3) This issue could be divided into 2 sub-issues: i) Not accepting 2 or more numerical labels. ii) Displaying $(ARG1) instead of the actual label name. 4) This issue may make VBA macro conversion a bit more difficult. 5) Quick fix: replace numerical labels with non-numerical labels. For this, you can use the following regular expression and replace string: Search for: \<([0-9]+)\> Replace with: label_& (This didn't work for me in the Find and Replace function of the Basic editor, try the Find and Replace function of OpenOffice.org Writer instead.)
TM->JSK: please have a look.
Sorry for the mistake, the intended steps are of course: 3) Create a new module in the new document. 4) (You don't have to create Sub Main since it is created automatically.)
I'm sorry for the long description. Below is a brief version to aide easy confirmation. Write any OOo Basic code containing two or more numerical labels (with or without colons) and it won't compile. The simplest sub to demonstrate the effect: Sub Main 1 2 End Sub
Confirming with OO2.2 on WinXP - "Sub Main 1 2 End Sub" produces error message "Basic syntax error. Label $(ARG1) already defined".
To AB, set target 3.x
STARTED
Reset assigne to the default "issues@openoffice.apache.org".