Issue 50102 - Basic : Private Sub not correctly handled
Summary: Basic : Private Sub not correctly handled
Status: ACCEPTED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: 680m100
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: AOO Later
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 10:37 UTC by bmarcelly
Modified: 2017-05-20 11:31 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2005-05-31 10:37:58 UTC
OOo 2.0 introduces Private (and Public) keywords in a Sub (or Function) definition. 
This is described nowhere but some programmers begin to use it.
This bug occurs during macro development and can be very disturbing. Steps to 
reproduce:
The following macros are defined in Standard library of a Writer document.

- in Module 1 create this:
Option Explicit

Private Sub Main1
  MsgBox("macro Main1")
End Sub

- in Module 2 create this:
Option Explicit

Sub Main2
  CompatibilityMode(True)
  Main1
End Sub

- run macro Main2. Of course there is an error "Variable not defined" because Main1 is 
Private.

- suppress "Private" in the definition of Main1. Run the macro Main2 : still an error 
"Variable not defined". This is incorrect because Main1 is now implicitly Public.

- add "Public" in the definition of Main1. Run the macro Main2 : still an error 
"Variable not defined". This is incorrect because Main1 is explicitly Public.

- save the document now, close it, reopen it. Run the macro Main2 : no error. This is 
correct now!
Comment 1 bmarcelly 2005-05-31 12:38:49 UTC
In fact the problem already exists with OOo 1.1.3 (I cannot tested earlier version).
Comment 2 noel.power 2005-09-02 08:56:35 UTC
reassign to ab
Comment 3 ab 2005-09-02 09:47:27 UTC
This is already covered by the StarOffice internal task #115166. But I will 
prefer this one as it can be better tracked for OOo and mark the other one
as duplicate.
Comment 4 Marcus 2017-05-20 11:31:32 UTC
Reset assigne to the default "issues@openoffice.apache.org".