Steps to setting up event-driven exchanges - advise links
This section describes how to set up event-driven exchanges.
To set up and manage event-driven exchanges for a data item:
1. Specify the server data item in a DDE ADVISE statement, using the START option. This creates an advise link to the data item from ABL. From this point in the procedure, the DDE server monitors the specified data item, notifying ABL whenever its value changes.
2. Add an ON DDE-NOTIFY OF FRAMEDDEframe statement, where DDEframe is the name of the frame that owns the conversation. In the trigger block for the statement, invoke the DDE GET statement to retrieve the new value of the data item (just like a DDE REQUEST) and process it as you want. ABL triggers this DDE-NOTIFY event and posts it to the appropriate DDE frame when notified of the value change. The OpenEdge client application then executes the event trigger when it blocks for I/O or invokes the PROCESS EVENTS statement. If you have more than one advise link established for the conversation, you can determine what data item changed by checking the value of the DDE-ITEM attribute of the DDE frame.
Note: In general, do not block for I/O (for example, invoke an UPDATE statement) or invoke a PROCESS EVENTS statement within the trigger for a DDE-NOTIFY event. This can cause ABL to update the DDE frame attributes for a new DDE-NOTIFY event before you have completed the processing for a prior event.
3. At any point in the procedure, if you want to stop event-driven exchanges for the data item, specify the data item in a DDE ADVISE statement using the STOP option. This removes the advise link and directs the server to cease monitoring value changes in the data item. This does not terminate the conversation in any way and you can continue to access the data item with other exchanges or create another advise link to the data item.