StartHotLink

Description

Establishes a hot link with a DDE server application so that PowerBuilder is notified immediately of any changes in the specified data. When the data changes in the server application, it triggers a HotLinkAlarm event in the current application.

Syntax

StartHotLink ( location, applname, topic )

Argument

Description

location

A string whose value is the location of the data in which a change of value triggers a HotLinkAlarm event. The format of the location depends on the application that contains the data.

applname

A string whose value is the DDE name of the server application.

topic

A string identifying the data or the instance of the application in which a change triggers a HotLinkAlarm event (for example, in Microsoft Excel, the topic name could be the name of an open spreadsheet).

Returns

Integer. Returns 1 if it succeeds. If an error occurs, StartHotLink returns a negative integer. Values are:

If any argument’s value is null, StartHotLink returns null.

Usage

After establishing a hot link, you can include the following functions in the HotLinkAlarm event:

Examples

Example 1

In this example, another PowerBuilder application has called the StartServerDDE function and identified itself as MyPBApp. This statement in your application establishes a hot link to data in MyPBApp. The values you specify for location and topic depend on conventions established by MyPBApp:

StartHotLink("Any", "MyPBApp", "Any")

Example 2

This statement establishes a hot link with Microsoft Excel, which notifies the PowerBuilder window when the data at row 1 column 2 of REGION.XLS changes:

StartHotLink("R1C2", "Excel", "Region.XLS")

See also