Compiler Options, Runtime Conditions

Compiler options specified at the module level affect LibreOffice Basic compiler checks and error messages. Basic syntax as well as Basic set of instructions can be different according to the options that are in use. The less Option, the easiest and tolerant LibreOffice Basic language is. The more Option, the richer and controlled Basic language gets.


Compiler options must be specified before the executable program code in a module.


Option Statement diagram

Option Base Statement

αž€αŸ†αžŽαžαŸ‹β€‹αž–αŸ’αžšαŸ†αžŠαŸ‚αž“β€‹αžαžΆαž„β€‹αž€αŸ’αžšαŸ„αž˜β€‹αž›αŸ†αž“αžΆαŸ†αžŠαžΎαž˜ αžŸαž˜αŸ’αžšαžΆαž”αŸ‹β€‹αž’αžΆαžšαŸβ€‹αž‡αžΆ 0 ឬ 1Β αŸ”

Option ClassModule Statement

Specifies that the module is a class module that contains members, properties, procedures and functions.

Option Compatible Statement

Option Compatible turns on the VBA-compatible Basic compiler mode at the module level.

CompatibilityMode() Function

CompatibilityMode() function is controlling runtime mode and affects all code executed after setting or resetting the mode.

Option Explicit Statement

αž”αž‰αŸ’αž‡αžΆαž€αŸ‹β€‹αžαžΆ αž‚αŸ’αžšαž”αŸ‹β€‹αž’αžαŸαžšβ€‹αž€αŸ’αž“αž»αž„β€‹αž€αžΌαžŠβ€‹αž€αž˜αŸ’αž˜αžœαž·αž’αžΈβ€‹αžαŸ’αžšαžΌαžœβ€‹αžαŸ‚β€‹αž”αŸ’αžšαž€αžΆαžŸβ€‹αž‡αžΆαž€αŸ‹αž›αžΆαž€αŸ‹β€‹αž‡αžΆαž˜αž½αž™β€‹αžŸαŸαž…αž€αŸ’αžαžΈβ€‹αžαŸ’αž›αŸ‚αž„β€‹αž€αžΆαžšαžŽαŸ DimΒ αŸ”

Option Private Module

Specifies that the scope of the module is that of the Basic library it belongs to.

Option VBASupport Statement

Specifies that LibreOffice Basic will support some VBA statements, functions and objects.


Options specified at the module level also affect LibreOffice Basic runtime conditions. The behaviour of LibreOffice Basic instructions can differ.

Please support us!