DdeCallback_RequestΒΆ

DdeCallback_Request is called by the client to request data from UniPlot.

ssData = DdeCallback_Request(hConv, ssItem, ssTopic)

Return Value

ssData is a scalar string.

Parameters

hConv

hConv is the channel number.

ssItem

ssItem is the item name.

ssTopic

ssTopic is the topic name.

Example

The following Word-Basic program requests the date from UniPlot:

Sub Main
    chan = DDEInitiate("UniPlotSL", "test")
    StrResult$ = DDERequest$(chan, "date")
    MsgBox(StrResult$)
    DDETerminate(chan)
End Sub

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 DdeCallback_Request function in 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

id-724605