Call   Statement

This statement transfers control to procedure, and ignores its return value.

Call procedure_name([argument_list])
-or-
Call class_name.procedure_name([argument_list])
-or-
Call object_name.procedure_name([argument_list])

Prerequisites

None

Parameters

procedure_name

The name of procedure to be called. This procedure can be either user-defined or built-in. It can be a function (Function), a subroutine(Sub) or a method of a built-in class.

class_name

The name of a built-in class of which procedure_name is a member.

object_name

The name of a object that is an instance of a built-in class of which procedure_name is a member

argument_list

A list of argument values that are passed to the procedure. The argument_list may be empty, or may be a list of argument values, separated by “,”, that correspond to the arguments in the called procedure.

argument, argument, argument

The type and number of arguments must match the parameters in the declaration of the called procedure. For a ByVal parameter, the argument can be any expression of the matching type. For a ByRef parameter, the argument must be a variable of the matching type.

Remarks

When a procedure is called, the current procedure is suspended until the called procedure exits. Some procedures (e.g. Function procedures) can return a value. The Call statement does not allow the returned value to be accessed.

The Call statement is optional. It can be omitted and the procedure_name specified as the first item in the statement.

Examples

Call my_subroutine(10, 20, 30)
my_subroutine(10, 20, 30) ' Same as above
Call Move.OneAxis(1, 30, 0, MyProfile)

See Also

Statements |Function Statements | Sub Statements