Call Statement

Transfers the control of the program to a subroutine, a function, or a procedure of a Dynamic Link Library (DLL). The keyword, type and number of parameters is dependent on the routine that is being called.

Syntaks:

Anropsuttrykk-diagram


[Call] navn [(] [param :=] value, ... [)]

Parametre:

name: Name of the subroutine, the function, or the DLL that you want to call

param: Navn på søkeordparameter som skal overføres til rutinen, etterfulgt av dens verdi. Navnet må samsvare med rutineerklæringen. Nøkkelord er valgfrie og kan brukes i hvilken som helst rekkefølge.

verdi: Posisjonsparameterverdi. Typen er avhengig av rutinen som blir anropt

note

Når du blander posisjons- og nøkkelordparametere, må du sørge for at posisjonsparametere følger den rutinemessige deklarasjonsrekkefølgen.


tip

When a function is used as an expression, enclosing parameters with brackets becomes necessary. Using a Declare statement is compulsory prior to call a DLL.


Eksempel:


Sub ExampleCall
    Dim value As String
    value = "LibreOffice"
    Call aRoutine value
    aRoutine text := value
End Sub

Sub aRoutine (text as String)
    Msgbox text
End Sub