https://bugs.documentfoundation.org/show_bug.cgi?id=166146

            Bug ID: 166146
           Summary: Public constants SEEM to be treated as variables
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

If I create a Public constant in a module (Module1) and try to use it in
another module (Module2 or Module3) then I get a syntax error.

Module1:
Option VbaSupport 1
Option Compatible
Option Explicit
REM  *****  BASIC  *****
public const vbOKOnly = 0
public const vbInformation = 64
Sub Main
End Sub

Module2:
Option VbaSupport 1
Option Compatible
Option Explicit
REM  *****  BASIC  *****
Private Const MyConstant1 = 0+64
Private Const MyConstant2 = vbOKOnly  ' Syntax Error?
Sub Main
End Sub

Module3:
Option VbaSupport 1
Option Compatible
Option Explicit
REM  *****  BASIC  *****
public Sub InfoBox( _
        aStrings As Variant, _
        Optional sTitle As String = "Information", _
        Optional xButtons As VbMsgBoxStyle = vbOKOnly + vbInformation _
        )
    MsgBox Join(aStrings, vbCrLf), xButtons, sTitle
End Sub

This bug seems to go all the way back to Apache OpenOffice (AOO) Bugzilla –
Issue 118031: "Allow to declare a Constant dependent of a Public Constant
declared in another module" (2011-2014).

Version: 24.8.5.2 (X86_64) / LibreOffice Community
Build ID: fddf2685c70b461e7832239a0162a77216259f22
CPU threads: 16; OS: Windows 10 X86_64 (10.0 build 19045); UI render:
Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

I'll try 25.2.2 after reboot.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to