Summary: | Enum Statement Basic documentation is misleading | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Mike Kaganski <mikekaganski> |
Component: | Documentation | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | himajin100000, LibreOfficiant, olivier.hallot, rafael.palma.lima, xiscofauli |
Priority: | medium | ||
Version: | Inherited From OOo | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 127592 |
Description
Mike Kaganski
2021-11-18 11:09:33 UTC
Moving to NEW When switching to Option Compatible, the Basic example in help does not function. Please also note that an enumeration is always private, regardless of the Private/Public specifier that preceedes it. The only way to make a Enum.eration public is to create a function that exposes it publicly. (In reply to Alain Romedenne from comment #2) > When switching to Option Compatible, the Basic example in help does not > function. That would mean a bug. Option Compatible indeed enables enums; e.g., with and without Option Compatible, (without VBASupport) you get different results compiling the module with enums - it would be a syntax error without Option Compatible. VBASupport should only change runtime, so inability to use compile-time structs is a bug. (In reply to Mike Kaganski from comment #3) > That would mean a bug. Option Compatible indeed enables enums; e.g., with > and without Option Compatible, (without VBASupport) you get different > results compiling the module with enums - it would be a syntax error without > Option Compatible. VBASupport should only change runtime, so inability to > use compile-time structs is a bug. The following code compiles both with "Option Compatible" and "Option VBASupport 1"; however it only runs with "Option VBASupport 1". Enum eWindowManager WINDOWS = 1 ' Windows OS2PM = 2 ' OS/2 Presentation Manager MACINTOSH = 3 ' Macintosh MOTIF = 4 ' Motif Window Manager / Unix-like OPENLOOK = 5 ' Open Look / Unix-like End Enum Sub EnumTest MsgBox eWindowManager.WINDOWS End Sub @Mike, maybe Enum is supposed to be available only with VBASupport. See the following test, which uses VBASupport (not Option Compatible) https://opengrok.libreoffice.org/xref/core/basic/qa/vba_tests/enum.vb?r=66b135fa More information regarding Enum statement can be found in "Enum.erations or Constant groups" post at https://forum.openoffice.org/fr/forum/viewtopic.php?f=8&t=58988 See enum_en.odt attached file. |