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 |
<span>StartHotLink</span> ( <span>location</span>, <span>applname</span>, <span>topic </span>{, <span>bAnsi</span>} ) |
|
Argument |
Description |
|---|---|
|
location |
A string whose value is the location |
|
applname |
A string whose value is the DDE name |
|
topic |
A string identifying the data or the |
|
bAnsi |
A boolean identifying whether the string |
Return Values
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 |
<span>StartHotLink</span>("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 |
<span>StartHotLink</span>("R1C2", "Excel", "Region.XLS") |