MATLAB Application Program Interface
  Go to function:
    Search    Help Desk 
ddeadv    Examples

Set up advisory link between MATLAB and DDE server application

Syntax

Arguments

rc
  The return code: 0 indicates the function call failed, 1 indicates it succeeded.

channel
  The channel assigned to the conversation, returned by ddeinit.

item
  A string that specifies the DDE item name for the advisory link. Changing the data identified by item at the server triggers the advisory link.

callback
  A string that specifies the callback that is evaluated on update notification. Changing item at the server causes callback to get passed to the eval function to be evaluated.

upmtx
  (optional) A string that specifies the name of a matrix that holds data sent with update notification. If upmtx is included, changing item at the server causes upmtx to be updated with the revised data.

Specifying an update matrix creates a hot link. Omitting upmtx or specifying it as an empty string, creates a warm link. If upmtx exists in the workspace, its contents get overwritten. If upmtx does not exist, it is created.

format
  (optional) A two-element array that specifies the format of the data to be sent on update.

The first element specifies the Windows clipboard format to use for the data. MATLAB supports only Text format, 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 a value of 0) and STRING (which corresponds to a value of 1).

The default format array is [1 0].

timeout
  (optional) A scalar that specifies the time-out limit for this operation. timeout is specified in milliseconds (1000 milliseconds = 1 second).

If advisory link is not established within timeout milliseconds, the function fails. The default value of timeout is three seconds.

Description

ddeadv sets up an advisory link (described in the "DDE Advisory Links" section of the Application Program Interface Guide) between MATLAB and a server application.

When the data identified by the item argument changes, the string specified by the callback argument is passed to the eval function and evaluated. If the advisory link is a hot link, DDE modifies upmtx, the update matrix, to reflect the data in item.

If item corresponds to a range of data values, a change to any value in the range causes callback to be evaluated.

Example



[ Previous | Help Desk | Next ]