|Navigation: Language Reference > App A - DDE, OLE, and OCX > DDE Procedures >====== DDECLIENT (return DDE client channel) ======|
DDECLIENT( [ application ] [, topic ] )
|DDECLIENT||Returns a new DDE client channel number.|
|application||A string constant or variable containing the name of the server application to link to. Usually, this is the name of the application. If omitted, the first DDE server application available is used.|
|topic||A string constant or variable containing the name of the application-specific topic. If omitted, the first topic available in the application is used.|
The DDECLIENT procedure returns a new DDE client channel number for the application and topic. If the application is not currently executing, DDECLIENT returns zero (0).
Typically, when opening a DDE channel as the client, the application is the name of the server application. The topic is a string that the application has either registered with Windows as a valid topic for the application, or represents some value that tells the application what data to provide. You can use the DDEQUERY procedure to determine the applications and topics currently registered with Windows.
Return Data Type: LONG
!Open as client to Excel spreadsheet:
ExcelServer = DDECLIENT('Excel','MySheet.XLS')
IF NOT ExcelServer !If the server is not running
MESSAGE('Please start Excel') !alert the user to start it
RETURN !and try again
OF EVENT:DDEdata !As changed data comes from Excel
PassedData(DDEReadVal) !process the new data