LibreOffice 7.4 laguntza
CompatibilityMode() function controls or queries runtime mode. It affects all code executed after setting or resetting the runtime mode.
Erabili eginbide hau kontuz, adibidez dokumentuak bihurtzeko soilik.
CompatibilityMode(Optional Enable As Boolean) As Boolean
CompatibilityMode function always returns the mode that is active after its execution. That is if called with argument, it returns the new mode, if called without argument, it returns active mode without modifying it.
Enable: Sets or unsets new compatibility mode when the argument is present.
CompatibilityMode function relates to Option VBASupport 1, in which case it always returns True. It is unrelated to Option Compatible compiler directive.
Funtzio horrek honako egoeratan du eragina edo lagundu dezake:
Scoping of variables.
RmDir komandoa VBA moduan exekutatzean. VBA erabiltzean, direktorio hutsak soilik kentzen dira RmDir bidez, eta LibreOffice Basic bidez direktorio bat modu errekurtsiboan kentzen da.
Basic-en Dir komandoaren portaera aldatzean. Dir komandoaren direktorio-banderak (16) esan nahi du LibreOffice Basic-en direktorioak soilik itzuliko direla. VBAn fitxategi normalak eta direktorioak itzultzen dira.
Color components calculation with the Red and Blue functions which are interchanged (The Green function is not affected).
Hutsik EZ dagoen file:///home/me/Test direktorio bat emanda
Sub RemoveDir
MsgBox CompatibilityMode() ' False
CompatibilityMode( True )
RmDir( "file:///home/me/Test" )
CompatibilityMode False
MsgBox CompatibilityMode ' False
End Sub
With CompatibilityMode( True ) the program raises an error, otherwise the Test directory and all its content is deleted.
Dir portaera aldatzea
Sub VBADirCommand
CompatibilityMode( Enable := True ) ' Shows also normal files
Entry$ = Dir( "file:///home/me/Tmp/*.*", 16 )
Total$ = ""
While Entry$ <> ""
Total$ = Total$ + Entry$ + Chr$(13)
Entry$ = Dir
Wend
MsgBox Total$
CompatibilityMode Enable := False ' Shows only directories
End Sub