Variant.MissingParam

Syntax

MissingParam: Variant;

Description

The MissingParam property returns missing value.

Comments

This property is used to work with COM objects. The COM method, which took on the MissingParam value, should use the default parameter value on executing. If MissingParam is passed as value of the parameter, for which the default value is missed, exception is thrown.

Example

The executed method has the following signature: MySub(A: Integer; B: String = "_"; C: Double = 100). To execute this method and specify whether it is necessary to use the default value instead of the value of the B parameter, the Invoke method should be called as follows:

Var
    //variables list
    v: Variant;
Begin
    v := //Initialize object
    ...
    v.Invoke("MySub", C, Variant.MissingParam, A);

or:

Var
    //variables list
    v: Variant;
    Arr: Array Of Variant;
Begin
    v := //Initialize object
    ...
    Arr := New Variant[3];
    Arr[0] := C;
    Arr[1] := Variant.MissingParam;
    Arr[2] := A;
    v.Invoke("MySub", Arr);

See also:

Variant