https://bugs.documentfoundation.org/show_bug.cgi?id=146909
Bug ID: 146909
Summary: Missing/confused constants for MsgBox arg & return
value
Product: LibreOffice
Version: 7.3.0.0.alpha1+
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
In BASIC macros, the MsgBox function takes a parameter which specifies which
buttons to display, and returns an integer indicating which button was pressed.
Constants for these values are documented at
https://help.libreoffice.org/6.4/en-US/text/sbasic/shared/03010102.html
However the contstants
MB_ABORTRETRYCANCEL and
IDIGNORE
are not defined and referencing them returns an empty value, or if Option
Explicit is used, a runtime error.
However the mix-up is more complicated:
MB_ABORTRETRYCANCEL (value 2) is documented to "display Abort, Retry, and
*Ignore* buttons" (not "Abort"), and does so. So the name of the constant is
misleading.
Sure enough, there does exist a symbol MB_ABORTRETRYIGNORE defined by the
runtime system with value 2. So that should be documented, not ...CANCEL.
If MB_ABORTRETRYIGNORE is used and the user clicks the "Ignore" button, then 5
is returned. However there is no documented constant for 5 except for
IDIGNORE, which is missing.
====
SUMMARY:
1. MB_ABORTRETRYCANCEL in the documentation should be replaced with
MB_ABORTRETRYIGNORE
2. IDIGNORE, which appears to be correctly documented, needs to be defined so
it can be used.
(Check: Is there a different symbol defined for return value 5?)
===
I will attach a regression script which tests all the documented constants.
STEPS TO REPRODUCE:
1. start calc or open any spreadsheet
2. Tools->Macros->Edit Macros
3. Navigate to 'Module1' (or any available module) and past in the attached
test code. Do NOT use "Option Explicit" (or else run-time errors will occur
rather than error messages from the tester).
4. Put cursor in "TestMain" and Run->Run (or press F5)
--
You are receiving this mail because:
You are the assignee for the bug.