.. highlightlang:: us .. index:: UniPlot.Call2 .. _uniplot.call2: UniPlot.Call2 ============= .. us.tag UniPlot.Call2 NOTREADYENGLISH Programming.ActiveX New330 The :ref:`UniPlot.Call2` method can be used to invoke a UniPlot function from a different process (ActiveX-Controllern). :ref:`UniPlot.Call` returns a matrix, :ref:`UniPlot.Call2` returns a vector. .. function:: ret = UniPlot.Call2(ssFuncName, arg1, arg2, ...) .. us.return **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. .. us.params **Parameters** .. uparam:: ssFuncName *ssFuncName* is the name of a UniScript function. .. uparam:: 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. .. us.example **Example** The following Excel program (VBA) invokes UniPlot to display a ref:`MessageBox`: .. highlight:: none :: 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) .. highlight:: us .. us.example **Beispiel** The following Excel program (VBA) invokes :ref:`UniPlot.Call`, :ref:`UniPlot.Call2`. It invokes the :ref:`UniScript.Call` and :ref:`UniScript.Call2` of the UniScript-Server ``usserv32.exe`` as well. .. image:: S:/uniplot-obj/images/VBA.* The VBA-Debugger will display the return values of ``Call``- and ``Call2``. ``Call`` returns a matrix, ``Call2`` returns a vector. .. highlight:: basic :: 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 .. highlight:: us .. seealso:: :ref:`overview-programming`, :ref:`UniPlot.Visible`, :ref:`UniPlot.Caption` :sub:`id-537400`