vcastΒΆ

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.

m = vcast(vm)
m = vcast(vm, nType)

Return Value

m is the converted matrix.

Parameters

vm

vm is a variant matrix.

nType

nType is one of the following values:

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 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.

Example

m = [1, "1"];
vcast(m)
1.0000 0.0000

History

Version Description
5.30 New.

id-1169174