User`s guide
Utility Library Classes
D-5
Parameters.
Return Value.
None.
Remarks. This function always frees the contents of pVarArg before processing
the list.
Example. This example uses MWPack in a formula function to produce a
varargin cell to pass as an input parameter to a method compiled from a
MATLAB function with the signature
function y = mysum(varargin)
y = sum([varargin{:}]);
The function returns the sum of the elements in varargin. Assume that this
function is a method of a class named
myclass that is included in a component
named
mycomponent with a version of 1.0. The Visual Basic function allows up
to 10 inputs, and returns the result
y. If an error occurs, the function returns
the error string. This function assumes that
MWInitApplication has been
previously called.
Function mysum(Optional V0 As Variant, _
Optional V1 As Variant, _
Optional V2 As Variant, _
Optional V3 As Variant, _
Optional V4 As Variant, _
Optional V5 As Variant, _
Optional V6 As Variant, _
Optional V7 As Variant, _
Optional V8 As Variant, _
Optional V9 As Variant) As Variant
Dim y As Variant
Dim varargin As Variant
Argument Type Description
pVarArg Variant
Receives the resulting array
[Var0], [Var1], Variant
Optional list of Variants to pack into
the array. From 0 to 32 arguments can
be passed.