Navigation: Language Reference > App A - DDE, OLE, and OCX > DDE Procedures >====== DDECHANNEL (return DDE channel number) ====== | |
DDECHANNEL( )
The DDECHANNEL procedure returns a LONG integer containing the channel number of the DDE client or server application that has just posted a DDE event. This is the same value returned by the DDESERVER or DDECLIENT procedure when the DDE channel is established.
Return Data Type: LONG
Example:
WinOne WINDOW,AT(0,0,160,400)
END
TimeServer LONG
DateServer LONG
FormatTime STRING(5)
FormatDate STRING(8)
CODE
OPEN(WinOne)
TimeServer = DDESERVER('SomeApp','Time') !Open as server
DateServer = DDESERVER('SomeApp','Date') !Open as server
ACCEPT
CASE EVENT()
OF EVENT:DDErequest
CASE DDECHANNEL() !Check which channel
OF TimeServer
FormatTime = FORMAT(CLOCK(),@T1)
DDEWRITE(TimeServer,DDE:manual,'Time',FormatTime)
OF DateServer
FormatDate = FORMAT(TODAY(),@D1)
DDEWRITE(DateServer,DDE:manual,'Date',FormatDate)
END
END
END
See Also: