CompatibilityMode documentation  lacks the information about its return value, and about its boolean argument being optional.
It only sets new compatibility mode when the optional argument is present; it always returns the mode that is active after its execution (i.e., if called with argument, it returns the new mode; if called without argument, it returns active mode without modifying it). The source code is at .
Also, there are examples making use of this function: e.g., . They do not reset the compatibility mode back after changing it for a task; that is bad practice, and *may* create a false impression in readers that the mode that is set by the function is local to current method scope - while the new mode will be active to all the code run after leaving current method, potentially creating unwanted changes in logic. Those samples should be corrected to properly record the original state, and restore it after completing the necessary operations.
Additionally, the help page mentions both 'Option Compatible' and 'Option VBASupport', but it is not apparent from the discussion which of the two is actually relevant here. Setting compile-time 'Option Compatible' does *not* automatically make 'CompatibilityMode()' called without arguments to return true; while 'Option VBASupport 1' does. IMO the mention of the 'Option Compatible' should be removed from this page completely, except for a proposed "note that this function is not related to Option Compatible, and relates to Option VBASupport" notice.
It is not clear how can this *run-time* function affect "Creating enumerations with Enum statement" compile-time thing (also mentioned on this help page) - maybe it should be removed from here, and moved to 'Option Compatible' page.
For those no reading C++ like, can you descibe a bit more compMode() arguments?
I may then be able to rework the affected help pages
I borrowed from:
[Compatibility of Star/OpenOffice Basic to VBA]
..to write 'Option Compatible' and 'CompatibilityMode()' help content.
It surely needs refreshment
(In reply to Alain Romedenne from comment #2)
> For those no reading C++ like, can you descibe a bit more compMode()
Sorry, what is "compMode"?
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":
tdf#145752 Correction to CompatibilityMode() help page