UniPlot.Call2ΒΆ
The UniPlot.Call2 method can be used to invoke a UniPlot function from a different process (ActiveX-Controllern). UniPlot.Call returns a matrix, UniPlot.Call2 returns a vector.
- ret = UniPlot.Call2(ssFuncName, arg1, arg2, ...)
Return Value
ret is the return value. The following data types are supported: If
ssFuncName returns a scalar value (1 x 1 matrix), ret contains a scalar
value of type VT_R8
.
If ssFuncName returns a vector, (1 x n-matrix or n x 1-matrix) ret contains a 1 x n-vector.
If ssFuncName returns a matrix (n x m-matrix, n, m != 1), ret contains a n x m-matrix.
UniScript string matrices will be converted to VT_BSTR
.
Other UniScript types (UniScript variant matrix, Objects, complex numbers) are not supported.
Parameters
- ssFuncName
ssFuncName is the name of a UniScript function.
- arg1
arg1 is the first parameter. The number of parameters is limited from 0 to 16 parameters. The following data types are supported:
Scalar Elements:
VT_UI1, VT_I2, VT_I4, VT_R4, VT_R8, VT_VARIANT, VT_BSTR, VT_DISPATCH.
Vectors (Arrays with dimension 1):
VT_R8, VT_VARIANT, VT_BSTR.
Example
The following Excel program (VBA) invokes UniPlot to display a ref:MessageBox:
ssMessage$ = "This is a Test"
Dim svStyles(2) As String
svStyles(0) = "Test"
svStyles(1) = "ICONSTOP"
svStyles(2) = "YESNO"
Set upApp = CreateObject("UniPlot.Application")
YesNo = upApp.Call("MessageBox", ssMessage$, svStyles)
Beispiel
The following Excel program (VBA) invokes UniPlot.Call, UniPlot.Call2.
It invokes the UniScript.Call and UniScript.Call2 of the UniScript-Server
usserv32.exe
as well.
The VBA-Debugger will display the return values of Call
- and Call2
.
Call
returns a matrix, Call2
returns a vector.
Sub Test()
Dim a(1 To 3) As Double
Set up = CreateObject("UniPlot.Application")
Set us = CreateObject("UniScript32")
a(1) = 1
a(2) = 2
a(3) = 3
b = up.Call("sin", a)
c = up.Call2("sin", a)
d = us.Call("sin", a)
e = us.Call2("sin", a)
End Sub
See also
id-537400