DADiSP Worksheet Functions > Function Categories > ActiveX > Automation Server > PUTCOMPLEXDATA

 

PUTCOMPLEXDATA

Purpose:

Stores real or complex data to a Window or variable as a variant to DADiSP’s ActiveX Automation Server.

Syntax:

void PutComplexData(

[in] BSTR "name", [in] VARIANT real, [in] VARIANT imag, [in] INT form)

"name"

-

A string, the name of the Window or variable to store.

real

-

A variant, the source array for the real or magnitude part.

imag

-

A variant, the source array for the imaginary or phase part. Set to empty to ignore.

form

-

An integer. The complex form of the returned data.

0:

Real / Imaginary

1:

Magintude / Phase

Returns:

Nothing.

Example:

Visual Basic Example:

 

Dim DADiSP as Object

Dim RealData(1, 3) as Variant

Dim ImagData(1, 3) as Variant

Dim ResultR as Double

Dim ResultI as Double

 

’’’ Create VB data array

For i = 0 To 1

    For j = 0 To 3 

        RealData(i, j) = (i + 1) * (j + 1) 

        ImagData(i, j) = 100 * RealData(i, j) 

    Next j 

Next i

 

’’’ Connect to DADiSP

Set DADiSP = CreateObject("dadisp.application")

 

’’’ put complex array to variable a

Call DADiSP.PutComplexData("a", RealData, ImagData, 0)

 

’’’ scale by 10

Call DADiSP.Execute("a *= 10;")

 

’’’ get result

Call DADiSP.GetComplexData("a", RealData, ImagData, 0)

 

’’’ show result

For i = 0 To 1

    For j = 0 To 3 

        ResultR = RealData(i, j) 

        ResultI = ImagData(i, j) 

    Next j 

Next i

 

 

Starts DADiSP as an ActiveX Automation server, and places a 2x4 complex array from Visual Basic into variable a. The variable is scaled by 10 and the scaled array is returned in the original VB variants.

 

If form was 1, RealData would contain the magnitude part and ImagData the phase part.

Remarks:

PutComplexData explicitly stores the data as a variant. See PUTCOMPLEXSERIES or PUTSERIES to store explicit SafeArrays.

See Also:

CALCULATE

EXECUTE

GETCOMPLEXDATA

GETCOMPLEXSERIES

GETDATA

GETSERIES

PUTCOMPLEXSERIES

PUTDATA

PUTFULLMATRIX

PUTSERIES