Contents Previous Next Subchapters

Transfer a Data Array to O-Matrix
Syntax status = OMServer.PutData(arraySize,dataSrc,NRows,NCols)
See Also computmatrix

Description
Transfers a data array to O-Matrix. The argument dataSrc must be a double-precision one-dimensional array containing values to transfer to O-Matrix. The argument arraySize is a positive integer scalar specifying the number of elements in the dataSrc vector. The arguments NRows and NCols are integer scalars specifying the number of rows and columns in the resultant O-Matrix matrix. Note that NRows*NCols must equal arraySize.

The returned value status is an integer OM Server Status code. This value will equal 1 if this function succeeded.

Example
Public OM As New OMServer

Sub Main()
    Dim status As Integer
    Dim omData(5) As Double
    Dim ix As Integer
    
    For ix = 0 To 5
        omData(ix) = ix
    Next ix
    
    status = OM.Open
    If status <> 1 Then
        MsgBox ("Unable to establish connection to O-Matrix")
    End If
    
    status = OM.PutData(6, omData(0), 2, 3)
    If status <> 1 Then
        MsgBox ("Unable to transfer data to O-Matrix")
    End If
End Sub
Press the F5 key to run the example.

This example creates a 6-element array, omData and passes this variable to O-Matrix as 2 row by 3 column matrix. You can verify that the data is available in O-Matrix by entering
     omlink("get")
at the command line in O-Matrix. This will display the following result in the Command output window
{
[ 0 , 2 , 4 ]
[ 1 , 3 , 5 ]
}
Practical applications will typically call the PutMatrix immediately after calling the PutData function.