Issue 18740 - Public variables in two modules of the same library fight
Summary: Public variables in two modules of the same library fight
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Linux, all
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-27 17:40 UTC by andrew
Modified: 2017-05-20 11:28 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 andrew 2003-08-27 17:40:48 UTC
In one library, create two modules.
In one module, declare a public variable as an Integer.
In the other module, declare a public variable as a Double.

No error occurs and you do not know which variable you will see in both 
modules until runtime.
Comment 1 ooo 2003-09-02 08:22:13 UTC
not API but StarBASIC
Comment 2 ab 2003-09-03 16:14:46 UTC
This is no error. Each module sees it's own variable.
VB also does not rise an error in this situation.
Comment 3 andrew 2003-09-06 04:10:31 UTC
Actually, each module does not see it's own variables.

In module one, add

Public ii As Integer
Sub aaa
  ii = 3.4
  bbb()
  Print "In module one ii = " & ii
End Sub


In module two, add

Public ii As Double
Sub bbb
  ii = 6.4
  Print "In module two ii = " & ii
End Sub

When I ran this, it printed 6.4 in aaa which is not only the wrong 
value, it is the wrong type! The Private type is not a problem...

If you mark the case as resolved, again, I will not re-open it, but 
you indicated that each module sees only it's own variable. 
Unfortunately, this is not the behavior that I see. If this has 
already been modified, then slap me around a little bit, I probably 
deserve it :-)You do an awesome job Andreas!

Ultimately, I am fine with it either way. My only complaint is that 
the same variable name had different types allowing me to know which 
was which...

I have not found a way to determine which version is seen. I have not 
bothered to find a deterministic algorithm for which variable is 
recognized...

Andrew Pitonyak
Comment 4 ab 2003-09-09 08:24:44 UTC
You're right, my test case was too simple. So relax, I will 
not slap you around! And thank you for the flowers... ;-)
Comment 5 christof.pintaske 2004-06-17 16:46:09 UTC
cp: retargeted to Office-Later due to limited ressources
Comment 6 berend.cornelius 2006-03-13 11:50:00 UTC
Another aspect of this problem is that also different Functions with the same
name are not identified correctly even if they have a different signature with
different parameters. In StarOffice we have a function
"GetDocumentType(oDocument)" in the Tools library and one "GetDocumentType()" in
the Launcher library
Comment 7 Marcus 2017-05-20 11:28:10 UTC
Reset assigne to the default "issues@openoffice.apache.org".