PUTCOMPLEXSERIES

Purpose:

Stores real or complex data of a specified form to a Window or variable as two SafeArrays to DADiSP’s ActiveX Automation Server.

Syntax:

void PutComplexSeries(

[in] BSTR "name", [in] SAFEARRAY(double) real, [in] SAFEARRAY(double) 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 Double

Dim ImagData(1, 3) as Double

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.PutComplexSeries("a", RealData, ImagData, 0)

 

’’’ scale by 10

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

 

’’’ get result

Call DADiSP.GetComplexSeries("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 arrays.

 

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

Remarks:

If the imaginary SafeArray is empty and the series is purely real, PutComplexSeries ignores the imaginary part. An empty array can be specified in Visual Basic with a declaration such as:

 

Dim MyArray() as Double

 

PutComplexSeries explicitly stores the data as a SafeArray. See PUTCOMPLEXDATA or PUTDATA to store variant data types.

See Also:

CALCULATE

EXECUTE

GETCOMPLEXDATA

GETCOMPLEXSERIES

GETDATA

GETSERIES

PUTCOMPLEXDATA

PUTDATA

PUTFULLMATRIX

PUTSERIES