Issue 59791 - Regression in Basic : constants constructs are limited to 79 character length
Summary: Regression in Basic : constants constructs are limited to 79 character length
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: OOo 2.0.1
Hardware: All Windows XP
: P2 Trivial (vote)
Target Milestone: OOo 2.0.2
Assignee: joerg.skottke
QA Contact: issues@framework
Keywords: regression
: 59800 (view as issue list)
Depends on:
Reported: 2005-12-26 08:56 UTC by bmarcelly
Modified: 2006-02-21 12:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2005-12-26 08:56:34 UTC
Found on build 8990
It could be a consequence of fixing IZ 45570

This code produces a compilation syntax error (main instruction in one long line):

Sub Main
const a = 
"12345678901234567890123456789012345678901234567890123456789012345678901234567890" & ""  
print a
End Sub

If you suppress one character in the main string the syntax error disappears.
If you construct the string with concatenation of substrings on several lines you get a 
syntax error for more than 79 characters in total.
The bug is related with the concatenation character & or +
There is no error if the long string is created in one step, without concatenation.

This bug is catastrophic because already existing and perfectly working macros may not 
be usable with 2.0.1.
The designer of new macros can stumble on not-understandable messages, because there 
is no fault.
Furthermore you have to make deep changes in your macros to circumvent this bug.
Comment 1 pavel 2005-12-26 20:03:01 UTC
Comment 2 pavel 2005-12-27 08:38:47 UTC
*** Issue 59800 has been marked as a duplicate of this issue. ***
Comment 3 noel.power 2006-01-31 12:21:53 UTC
Andreas, for you?
Comment 4 ab 2006-02-01 15:15:40 UTC
ab->bmarcelly: Like i59790 this task is not "catastrophic" and it's no P2 for sure,
as the rules say: "P2 marks severe problems which affect a _significant_ number 
of customers" and I doubt that you find such code even in 1 of 10.000 macros.
But indeed it's a regression: -> P3, OOo 2.0.3
Comment 5 bmarcelly 2006-02-01 17:24:05 UTC
"I doubt that you find such code even in 1 of 10.000 macros."
This sentence reminds me of Intel comment about the infamous Pentium bug.

Yes, my code is strange, but only because it is chosen as a simple and obvious 
example. The general case is when you create constant texts which will be displayed in 
a TextField control.
Here is a code extracted from a macro. There are many constants like this:
Public Const txt0402 = "---- Browsing pages ---- \n\n" & _
                       "Displays a list of the pages to help you choose the current 
page. \n" & _
                       "Pages are listed : \n" & _
                       "- either according to the current page order \n" & _
                       "- or in alphabetical order \n" & _
                       "   - distinguishing upper case from lower case \n" & _
                       "   - without attention to upper case / lower case \n\n" & _
                       "---- Action on pages ---- \n"

For your information, each \n is converted by program into chr(13) before storing the 
string in the TextField control. Now I get a syntax error and the macro can't work. If 
I suppress the concatenation and put the whole instruction in one line it becomes 
impossible to see the structure of the text.
Comment 6 ab 2006-02-02 10:08:49 UTC
ab->bmarcelly: Sorry, I did not read your initial description carefully enough,
especially the part "you get a syntax error for more than 79 characters in total".
So I thought the problem is only related to programs where one substring
extends 79 characters.

Now I agree that this one is really ugly and I will start to fix it immediately.
-> Target OOo 2.0.2
Comment 7 ab 2006-02-02 18:13:22 UTC
Fixed in cws ab24
Comment 8 ab 2006-02-03 11:30:13 UTC
ab->jsk: You should also check the bugdoc from i45570 as the fix
is more a re-fix of i45570 with fixing this task as a side effect.

re-open issue and reassign to
Comment 9 ab 2006-02-03 11:30:21 UTC
reassign to
Comment 10 ab 2006-02-03 11:30:26 UTC
reset resolution to FIXED
Comment 11 joerg.skottke 2006-02-07 07:09:41 UTC
Started QA
Comment 12 joerg.skottke 2006-02-07 10:15:37 UTC
Verified in cws ab24, Windows, additionally tried continuation lines and other
stuff that might make this code stumble.
Comment 13 joerg.skottke 2006-02-21 12:35:31 UTC
OK on MWS, closing