StartHotLink
PowerScript function
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
|
1 |
StartHotLink ( location, applname, topic {, bAnsi} ) |
|
Argument |
Description |
|---|---|
|
location |
A string whose value is the location of the data in which |
|
applname |
A string whose value is the DDE name of the server |
|
topic |
A string identifying the data or the instance of the |
|
bAnsi (optional) |
A boolean identifying whether the string to get from the |
Return value
Integer.
Returns 1 if it succeeds. If an error occurs, StartHotLink returns a
negative integer. Values are:
-1 — No server
-2 — Request denied
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:
-
GetDataDDEOrigin — To determine what application sent the
notification of changed data -
GetDataDDE — To obtain the new data
-
RespondRemote — To acknowledge receipt of the data
Examples
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:
|
1 |
StartHotLink("Any", "MyPBApp", "Any") |
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:
|
1 |
StartHotLink("R1C2", "Excel", "Region.XLS") |
See also