Starting a conversation with a server

dde_connect()

Start a conversation with a server


SYNTAX

dde_connect(service, topic)

Start a conversation with a server that supports the specified service and topic. The function returns 0 if the conversation is successfully started or is already running. If the service is not available, or if the topic is not available on the service, the function returns a negative value.

If more than one server has currently registered the specified service name, Windows selects one of these servers arbitrarily.

The exec command can be used to start a server that is not running. The command text must end with an ampersand (“&”). If the command fails, it returns a value of -1 in the Sculptor system variable sys.Status.

If a function such as dde_execute() or dde_getitem() is called without a conversation already having been started with the relevant service and topic, Sculptor calls dde_connect() automatically.


EXAMPLE

if (dde_connect("Excel", tmp.SheetName)) {
     error "Cannot connect to sheet " + tmp.SheetName
}

RELATED TOPICS

DDE

DDE functions

Arguments to DDE functions