Issue 101434 - ":" not handled when it appears immediately after "then"
Summary: ":" not handled when it appears immediately after "then"
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: Other All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: needhelp, oooqa
Depends on: 101491
Blocks:
  Show dependency tree
 
Reported: 2009-04-29 18:03 UTC by paolopiace
Modified: 2013-02-24 21:00 UTC (History)
3 users (show)

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


Attachments
The provided http address links to this exact spreadsheet (untar, please). (3.26 MB, text/plain)
2009-04-29 18:09 UTC, paolopiace
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description paolopiace 2009-04-29 18:03:37 UTC
Openoffice version: 2.4.1

The spreadsheet available through the reported link contains VBA code that works
well in EXCEL while it fails in CALC. CALC detects inexistent syntax issues in
the VBA code.

Please, open the spreadsheet and you will see the problem.

Best Regards.
Comment 1 paolopiace 2009-04-29 18:09:10 UTC
Created attachment 61893 [details]
The provided http address links to this exact spreadsheet (untar, please).
Comment 2 Rainer Bielefeld 2009-05-01 18:57:47 UTC
Modified Version due to report.
Not P1

I checked with "2.0.2  German version WIN XP: [680m5(Build9011)]" and indeed I
saw many cells with an error message "'Makro?".
No Idea whether this really is a VBA problem.

@paolopiace:
Thank you for your contribution. 
Before you file further issues or post again here, please read our guidelines on
<http://qa.openoffice.org/issue_handling/pre_submission.html> and  
<http://www.openoffice.org/bugs/bug_writing_guidelines.html>, then
contribute a clear step by step instruction.
Comment 3 Rainer Bielefeld 2009-05-01 19:17:49 UTC
My 3.1.0RC2 hangs when I try to open the sample document, I will file a separate
issue for that problem.
Comment 4 paolopiace 2009-05-01 20:07:59 UTC
I need to ask to rise this issue level to 4.
This problem is impacting three groups of the same company: Armenia, California
and Munich. Switching back and forth between the functioning Excel and Linux is
a big deal.
Comment 5 noel.power 2009-05-05 09:49:44 UTC
yup I see the syntax error, unfortunately the document hangs ( even with macros
non enabled ) so it is hard to see exactly where it is going wrong, need look
into this further. I would suggest just not enabling macros for this document
but it seems ( like someone else noticed ) that is seems to hang anyway
Comment 6 paolopiace 2009-05-05 16:28:06 UTC
Negative.
If you disable macros the spreadsheet opens and does not hang. Of course, not 
running the macros makes all cells appearing with unknown values.
If you enable macros now, you will see the pop-up message of the syntsx error.
Comment 7 noel.power 2009-05-05 21:01:47 UTC
if you change the line

If ID(j) Then: j1 = j1 + 1: b(i1, j1) = InputMtrx(i, j)
             ^
to

If ID(j) Then j1 = j1 + 1: b(i1, j1) = InputMtrx(i, j)

that should avoid the syntax error ( probably wont be the end of your problems
though ) also this is not a vba issue per se but a general basic one ( treatment
of ':' )

andreas, any idea? come across this before
Comment 8 paolopiace 2009-05-06 00:03:38 UTC
The VBA language allows (legally) to write as many statements as the user wants 
on the same line. When doing this, statements must be separated by a colon.

I did try the suggested correction before posting this issue on Apr 29.

Then, I removed the colons and put the following statements on new lines. The 
initial syntax error on "j" disappeared but things (errors) in general became 
much worse and incomprehensible.
Comment 9 noel.power 2009-05-06 09:49:56 UTC
>The VBA language allows (legally) to write as many statements as the user wants
>on the same line. When doing this, statements must be separated by a colon.
ahem, OpenOffice basic is not VBA, it does have a VBA compatibility mode,
regardless both OpenOffice basic and VBA share many common syntax, in this case
it appears that handling of ':' for appending separate statements could be
improved e.g. openoffice basic seems not to handle a ":" immediately after
"then"  ( as I have changed the bug summary to state )

>I did try the suggested correction before posting this issue on Apr 29.
so, this is exactly the bug that you are reporting, why didn't you state that
initially?

->ab can I pass this one to you ( well I just did ;-) )

>Then, I removed the colons and put the following statements on new lines. The
>initial syntax error on "j" disappeared but things (errors) in general became
>much worse and incomprehensible.
so, as pointed out by rainerbielefeld you need to look at the guidelines for
bugs, you need to help us help you, one bug per problem is the only sensible way
to ensure help to clarify/track/fix/address each individual issue. Furthermore
you can help by trying to breakdown those bugs by providing the smallest
possible example that demonstrates the problem in a reproducible way. You
understand the example that you provide better than we can and you are in a
position to break it down better than us. Please help with that and open
seperate issue for those you find.
Comment 10 ab 2009-05-06 11:05:13 UTC
2nd try to add this comment, so maybe it will appear twice afterwards... :-)

Obviously this is no general problem with writing multiple statements in a line,
but only with starting them with a colon instead of a statement because "Then"
is not part of the statement list but belongs to the "If" statement. So I doubt
that this problem will occur very often. Anyway I will have a look. -> NEW
Comment 11 ab 2009-06-17 09:31:28 UTC
STARTED, OOo 3.x