External Interfaces Reference Previous page   Next Page
ddereq

Request data from application

Syntax

Description

ddereq requests data from a server application via an established DDE conversation. ddereq returns a matrix containing the requested data or an empty matrix if the function is unsuccessful.

If you omit optional arguments that are not at the end of the argument list, you must substitute the empty matrix for the missing argument(s).

If successful, ddereq returns a matrix containing the requested data in variable, data. Otherwise, it returns an empty matrix.

Arguments
channel
Conversation channel from ddeinit.
item
String specifying the server application's DDE item name for the data requested.
format (optional)
Two-element array specifying the format of the data requested. The first element specifies the Windows clipboard format to use. The only currently supported format is cf_text, which corresponds to a value of 1. The second element specifies the type of the resultant matrix. Valid types are numeric (the default, which corresponds to 0) and string (which corresponds to a value of 1). The default format array is [1 0].
timeout (optional)
Scalar specifying the time-out limit for this operation. timeout is specified in milliseconds. (1000 milliseconds = 1 second). The default value of timeout is three seconds.

Examples

Assume that you have an Excel spreadsheet stocks.xls. This spreadsheet contains the prices of three stocks in row 3 (columns 1 through 3) and the number of shares of these stocks in rows 6 through 8 (column 2). Initiate conversation with Excel with the command

DDE functions require the rxcy reference style for Excel worksheets. In Excel terminology the prices are in r3c1:r3c3 and the shares in r6c2:r8c2.

Request the prices from Excel:

Next, request the number of shares of each stock:

See Also

ddeadv, ddeexec, ddeinit, ddepoke, ddeterm, ddeunadv


Previous page  ddepoke ddeterm Next page

© 1994-2005 The MathWorks, Inc.