Apache OpenOffice (AOO) Bugzilla – Issue 123669
BASIC Variable Scopes
Last modified: 2013-11-10 02:49:16 UTC
two bugs ? , variable scope of BASIC ================================================= 1st https://wiki.openoffice.org/wiki/Documentation/DevGuide/Basic/Variable_Scopes The Private command is used to declare variables that can only be used locally in a module. however, From the tests I've done, the module-level variables are always visible from the outside of the module, whether declared public or private indifferently es ' ModProvaScope private m_private_str as string public m_public_str as string Public Sub ValorizzaModVars m_private_str = " my_m_private_str " m_public_str = " my_m_public_str " end Sub ' ModProva sub ProvaScope call ValorizzaModVars msgbox m_private_str ' " my_m_private_str " msgbox m_public_str ' " my_m_public_str " msgbox ModProvaScope.m_private_str ' " my_m_private_str " msgbox ModProvaScope.m_public_str ' " my_m_public_str " end Sub ================================================== 2nd in oo BASIC is still possible to create a module-class just write at the beginning of the module option Compatible option ClassModule eg if the module is renamed ClsMyClass by another module you can create the object with set oMyClass = new ClsMyClass the scope-bug is that the class is visible only to other modules in the same workbook for example, if I define the module-class in the [Macros].Standard then this will no longer be visible from the inside of the modules of the worksheet current open files