.. highlightlang:: us .. index:: vcast .. _vcast: vcast ======= .. us.tag vcast NOTREADYENGLISH Programming.variant New5300 :ref:`vcast` converts a variant matrix to a real matrix, string matrix or a complex matrix. If the input variant matrix contains objects of COM object pointers the returned matrix is a variant matrix. .. function:: m = vcast(vm) m = vcast(vm, nType) .. us.return **Return Value** *m* is the converted matrix. .. us.params **Parameters** .. uparam:: vm *vm* is a variant matrix. .. uparam:: nType *nType* is one of the following values: .. list-table:: :header-rows: 1 * - Define - Value - Output Matrix * - VNUMBER - 0 - A real matrix is returned. All non real elements will be set to 0. * - VSTRING - 1 - A string matrix is returned. All non string elements will be set to string with the length 0. * - VCOMPLEX - 2 - A complex matrix is returned. All non complex elements are set to 0+0i. * - VOBJECT - 3 - A variant matrix is returned. All elements that are not UniScript objects (see :ref:`obj_create`) are set to 0. * - VCOMPOINTER - 4 - A variant matrix is returned. All elements that are not COM pointers are set to 0. If *nType* is not specified the matrix will be converted to the type of the first element of *vm*. .. us.example **Example** :: m = [1, "1"]; vcast(m) 1.0000 0.0000 .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.30 - New. .. seealso:: :ref:`overview-programming`, :ref:`vtype`, :ref:`vconvert`, :ref:`vmatrix`, :ref:`type` :sub:`id-1169174`