DADiSP Worksheet Functions > Function Categories > ActiveX > Automation Server > GETCOMPLEXDATA
Retrieves complex data from a command, Window or variable as two variants from DADiSP’s ActiveX Automation Server.
[out] INT result = GetComplexData( |
[in] BSTR "name", [out] VARIANT *real, [out] VARIANT *imag, [in] INT form) |
"name" |
- |
A string, the name of the source Window or variable to retrieve. |
||||
real |
- |
A variant, the destination array for the real or magnitude part. |
||||
imag |
- |
A variant, the destination array for the imaginary or phase part. |
||||
form |
- |
An integer. The complex form of the returned data.
|
An integer, 1 if successful.
Visual Basic Example:
Dim DADiSP as Object
Dim VBData(1000) as Double
Dim RealData as Variant
Dim ImagData as Variant
’’’ Create VB data array
For i = 0 To 1000
VBData(i) = Rnd()
Next i
’’’ Connect to DADiSP
Set DADiSP = CreateObject("dadisp.application")
’’’ Create a 2 Window Worksheet without prompting
Call DADiSP.Execute("newworksheet(2, 0)")
’’’ Put VB array in W1
Call DADiSP.PutSeries("W1", VBData)
’’’ Label W1
Call DADiSP.Execute("label(W1, 'Data from Visual Basic')")
’’’ get complex series in real /imag form
Call DADiSP.GetComplexData("sqrt(W1-mean(W1))", RealData, ImagData, 0)
’’’ show it
DADiSP.Visible = 1
Starts DADiSP as an ActiveX Automation server, creates a 2 Window Worksheet and places 1001 random samples from Visual Basic into W1. The Window is labeled. The mean of the data is removed and the square root of this series returned. Since some of the zero mean values are negative, the resulting square root series is complex. The real part of the series is returned in the variant RealData and the imaginary part is returned in ImagData.
If form was set to 1, RealData would contain the magnitude part while ImagData would contain the phase part.
If the return type is a series, GetComplexData creates arrays of the appropriate size.
GetComplexData returns data as a variant type. See GETCOMPLEXSERIES or GETSERIES to return a SafeArray.