Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Windows Dynamic Data Exchange : Exchanging data in conversations : Event-driven exchanges : Applications for event-driven exchanges
 
Applications for event-driven exchanges
You might use event-driven exchanges to tie data item values in a OpenEdge application to those in a spreadsheet, calender scheduler, or some other database application that might be running in your application environment. For example, the following code fragment retrieves the latest value of the cell at row 4, column 2 (the "B" column) in an Excel worksheet and stores it in an ABL editor field:
DEFINE VARIABLE sheet AS INTEGER   NO-UNDO.
DEFINE VARIABLE sty   AS CHARACTER NO-UNDO.
DEFINE VARIABLE ed    AS CHARACTER NO-UNDO VIEW-AS EDITOR SIZE 20 by 2.

ON DDE-NOTIFY OF FRAME MainFrame DO:
DDE GET sheet TARGET sty ITEM "r4c2".
sty = SUBSTR(sty, 1, 20). /* Drop the CR/LF */
ed:VALUE IN FRAME MainFrame = sty.
END.
...
DDE ADVISE sheet START ITEM "r4c2".
...