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

 

PUTDATA

Purpose:

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

Syntax:

[out] INT result = PutData(

[in] BSTR "dest", [in] VARIANT *data)

"dest"

-

A string, the destination. Any valid Window or variable name.

data

-

A variant, the data to store. Any string, scalar or array.

Returns:

An integer, 1 if successful.

Example:

Visual Basic Example:

 

Dim DADiSP as Object

Dim VBData(1000) as Double

Dim Result 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.PutData("W1", VBData)

 

’’’ Label W1

Call DADiSP.Execute("label(W1, 'Data from Visual Basic')")

 

’’’ get integral of W1

Result = DADiSP.GetData("integ(W1)")

 

’’’ 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 and the variant Result is a 1001x1 array containing the integration of the random data..

Remarks:

Any string, scalar or array can be stored in a DADiSP Window or variable.

 

PUTDATA stores a variant of any type into a DADiSP Window or variable. See PUTSERIES to explicitly store a SafeArray.

See Also:

CALCULATE

CASTVARIANT

CASTVARIANTARRAY

EVALUATE

EXECUTE

GETCHARARRAY

GETCOMPLEXDATA

GETCOMPLEXSERIES

GETDATA

GETFULLMATRIX

GETSERIES

GETVARIANTDATA

PUTCHARARRAY

PUTFULLMATRIX

PUTSERIES