Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

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.

Syntax:

Call Statement diagram


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

Parameters:

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

param: Keyword parameter name to pass to the routine, followed by its value. The name must match the routine declaration. Keywords are optional and can be used in any order.

value: Positional parameter value. The type is dependent on the routine that is being called

When mixing positional and keyword parameters, make sure positional parameters are following the routine declaration order.

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.

Example:


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

Sub aRoutine (text as String)
    Msgbox text
End Sub