Declare Statement

Proglašava i definira potprogram u DLL fileu iz kojeg želite da pokrenete LibreOffice Basic.

Pogledaj također: FreeLibrary

Sintaksa:

Declare {Sub | Function} Name Lib "Libname" [Alias "Aliasname"] [Parameter] [As Type]

Parametri:

Ime: Drukcije ime od onoga datog u DLL, da pozovete potprogram iz LibreOffice Basic.

Aliasname:ime potprograma je datu u DLL.

Libname: Datoteke ili sustav naziva DLL. Ova biblioteka je automatski učita prvi put da se koristi funkcija.

Argumentlist: List of parameters representing arguments that are passed to the procedure when it is called. The type and number of parameters is dependent on the executed procedure.

Type: Defines the data type of the value that is returned by a function procedure. You can exclude this parameter if a type-declaration character is entered after the name.

Warning Icon

da bi proslijedili parametar potprograma kao vrijednost, a ne kao referenca, parametar mora biti označen ključne riječi ByVal .


Primjer:

Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long )

Sub ExampleDeclare

Dim lValue As Long

    lValue = 5000

    MyMessageBeep( lValue )

    FreeLibrary("user32.dll" )

End Sub