.. highlightlang:: us .. index:: DdeCallback_Request .. _ddecallback_request: DdeCallback_Request =================== .. us.tag DdeCallback_Request ENGLISH :ref:`DdeCallback_Request` is called by the client to request data from UniPlot. .. function:: ssData = DdeCallback_Request(hConv, ssItem, ssTopic) .. us.return **Return Value** *ssData* is a scalar string. .. us.params **Parameters** .. uparam:: hConv *hConv* is the channel number. .. uparam:: ssItem *ssItem* is the item name. .. uparam:: ssTopic *ssTopic* is the topic name. .. us.example **Example** The following Word-Basic program requests the date from UniPlot: .. highlight:: basic :: Sub Main chan = DDEInitiate("UniPlotSL", "test") StrResult$ = DDERequest$(chan, "date") MsgBox(StrResult$) DDETerminate(chan) End Sub .. highlight:: us The Basic command ``StrResult$ = DDERequest$(chan, "date")``, requests the current date from UniPlot. To do so, we have to make the following changes to the :ref:`DdeCallback_Request` function in :file:`UniPlot/script/obj_dde.ic` file: :: def DdeCallback_Request(hConv, ssItem, ssTopic) { // this line is for debug purpose only printf("---Request---\n"); printf("Conversation-No.: %x, Item: %s, Topic: %s\n\n", .. hConv, ssItem, ssTopic); if (ssTopic == "date") { return "Today is the " + sum(date()); } return "OK"; } The standard DDE callback function of UniScript will create the following output into the command window: :: ---Connect--- Service: UniPlotSL, Topic: xyz ---ConnectConfirm--- Conversation-No.: 21000d00, Service: UniPlotSL, Topic: xyz ---Request--- Conversation-No.: 21000d00, Item: xyz, Topic: date ---Disconnect--- Conversation-No.: 21000d00 .. seealso:: :ref:`overview-dde`, :ref:`DdeCallback_Connect`, :ref:`DdeCallback_ConnectConfirm`, :ref:`DdeCallback_Disconnect`, :ref:`DdeCallback_Poke`, :ref:`DdeCallback_Execute` :sub:`id-724605`