Call Statement

Causes control to move to a procedure.

Syntax

[ Call ] procedure_name [ argument_list ]

Parts

Call
Optional keyword.
procedure_name
Mandatory name of a procedure.
argument_list
Optional one or more expressions with a comma between each. You can put parentheses (“( )”) around the list, but they are optional.

Instructions

You can use the keyword Call when you call a procedure, but it is optional. You can also use Call when you discard a returned value.

Examples

' The next three lines are equivalent.
Call MyProc()
Call MyProc
MyProc

' The next three lines are equivalent.
Call MyProc(1, 2, 3)
Call MyProc 1, 2, 3
MyProc(1, 2, 3)

Sub MyProc(Optional a As Int32, b As Int32, c As Int32)
    ' ...
End Sub

See also