Using Optional Parameters

COM supports the notion of optional parameters. Optional parameters, unless specified, are interpreted with some default value according to the COM component. However, DataFlex's FlexCOM technology requires you to specify all parameters when declaring and calling a method.

DataFlex provides the special keyword nothing to use as a place-filler when you wish to call a method but not specify a value for one or more of its optional parameters.

The following example demonstrates how to call a procedure and omit a value for one of its optional parameters:

Procedure MyProcedure Integer param1 Variant anOptionalParam

End_Procedure

 

Send MyProcedure 1234 Nothing

 

Notes

The keyword nothing replaces the old OLE_VT_OPTIONAL constant that was used in prior revisions of FlexCOM, which can not be used with FlexCOM 2 components.

 

See Also

Programming with COM – General Topics