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

            Bug ID: 171441
           Summary: REGRESSION Predefined identifiers when executing any
                    Basic function
           Product: LibreOffice
           Version: 26.2.1.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Description:
When starting any Basic macro, a number of variables are predefined and
preinitialized, apparently as Global or Public variables.

You can replace them with a Dim statement.

They don't generate an error when they are not declared before use while Option
Explicit is present.

I identified so far 6 of them: a, x, y, dialog, height, width.

Steps to Reproduce:
1. Create any new document => File + New + Text document
   Open the Basic IDE => Tools + Macros + Edit Macros...
   Browse to the module Module1 in your new document

2. Next code is present
      REM  *****  BASIC  *****

      Sub Main

      End Sub

3. Put the variables a, x, y, dialog, height, width as watched variables in the
watch window

4. Put your cursor on the line
      Sub Main
   and press F8

Actual Results:
- a is an integer, value = 0
- x, y, height, width are longs, value = 0
- dialog is an object containing (after expansion) the skeleton of an instance
of the SFDialogs.SF_Dialog class module !? 

Expected Results:
The watch window should not show any value for any identifier.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Other tests done:

Insert between Sub Main and End Sub
- a = 10
    => OK
- a = Array()
    => error "Object variable not set"

With Option Explicit
- a = 10
    => done, it should raise a "Variable not defined" error


All tests done on a fresh installation of

Version: 26.2.1.2 (X86_64)
Build ID: 8399f6259d8c87f40e7255cdb3c9b958f5e08948
CPU threads: 6; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

with pristine user settings: no extensions, no startup events, ...

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

Reply via email to