Navigation: Language Reference > App A - DDE, OLE, and OCX > DDE Procedures >====== DDESERVER (return DDE server channel) ====== | |
DDESERVER( [ application ] [, topic ] )
DDESERVER | Returns a new DDE server channel number. |
application | A string constant or variable containing the name of the application. Usually, this is the name of the application. If omitted, the filename of the application (without extension) is used. |
topic | A string constant or variable containing the name of the application-specific topic. If omitted, the application will respond to any data request. |
The DDESERVER procedure returns a new DDE server channel number for the application and topic. The channel number specifies a topic for which the application will provide data. This allows a single Clarion application to register as a DDE server for multiple topics.
Return Data Type: LONG
Example:
DDERetVal STRING(20)
WinOne WINDOW,AT(0,0,160,400)
ENTRY(@s20),USE(DDERetVal)
END
MyServer LONG
CODE
OPEN(WinOne)
MyServer = DDESERVER('MyApp','DataEntered') !Open as server
ACCEPT
CASE EVENT()
OF EVENT:DDErequest !As server for data requested once
DDEWRITE(MyServer,DDE:manual,'DataEntered',DDERetVal) !Provide data once
OF EVENT:DDEadvise !As server for constant update request
DDEWRITE(MyServer,15,'DataEntered',DDERetVal)
!Check for change every 15 seconds
!and provide data whenever changed
END
END
See Also: