Module Variable Scope in LibreOffice Basic 5

I’m new to LibreOffice BASIC and downloaded the OpenOffice BASIC Guide 3.0.0. On page 22 is says “Private variables are only available in the module in which they are defined.”

But I can access private variables across modules without errors.

Module1:
Private var1 as Integer

Module2:
Module1.var1 = 3
msgbox Module1.var1 ( returns 3 )

I’m confused. Is there a property that I’m not setting that enforces scope restrictions across modules or is it a LibreOffice problem or am I going mad? (don’t answer the “mad” bit)

Revised Question:
Perhaps this is a better example

Library1:
Module1:

Option Explicit

Private EmpNo as Integer

Public Sub PutEmpNo( ByVal inEmpNo as Integer)

EmpNo = inEmpNo

End Sub

Public Function GetEmpNo() as Integer
GetEmpNo() = EmpNo
End Function

Library2:
Module1:

Option Explicit

Sub Main

BasicLibraries.LoadLibrary(“Library1”)

MsgBox Library1.EmpModule.GetEmpNo() ’ = 0

Library1.EmpModule.PutEmpNo(15)

MsgBox Library1.EmpModule.GetEmpNo() ’ = 15 as expected

MsgBox Library1.EmpModule.EmpNo ’ = 15 ???

End Sub

A response to the same question put to the OpenOffice Forum seems to shed light on the matter…

“Indeed setting the Private attribute to a class internal variable should forbid to access its value both for reading or for writing. However the Private and Public attributes are simply ignored in StarBasic, independently from what they’re applied to: class variables, module variables, Subs, Functions, they’re all public even when the Private keyword is present. This has in fact as good as nothing to do with the OO programming facilities in StarBasic.”