DDE Links in DPL Programs (DPL Code)
Using special functions, you can include DDE links in DPL programs.
string Excel_1 = "a:\\spreadst\\chapter\\sheet1.xls"; excel(Excel_1,"Marketing_Costs") decision Marketing_Budget.{Low,Average,High} = 10000, // Marketing_Budget.Low 20000, // Marketing_Budget.Average 35000; // Marketing_Budget.High chance Sales_Level.{Low,Medium,High} | Marketing_Budget = {.6,.3,.1}, // Marketing_Budget.Low {.3,.5,.2}, // Marketing_Budget.Average {.1,.5,.4}; // Marketing_Budget.High excel(Excel_1,"Sales") value Sales_Level | Sales_Level = 2000, // Sales_Level.Low 3500, // Sales_Level.Medium 5000; // Sales_Level.High excel(Excel_1,"Net_Profit") value Net_Profit; sequence: decide about Marketing_Budget then gamble on Sales_Level and get Net_Profit
Notice that the definitions for the three nodes that are linked to the spreadsheet begin with a special function, excel(), that includes the name of the spreadsheet and the name of the cell to which to link. Because the spreadsheet name is repeated in each function name, it is easier to define it as a named string (Excel_1). You can specify that an import variable depends on certain events (and not on others).
excel(Excel_1,"Net_Profit") value Net_Profit (=Marketing_Budget+Sales_Level);
If an Excel macro should be run in lieu of sending a calculate command, the name of the macro is specified as a third argument to the excel() function.
excel(Excel_1,"Net_Profit", "[UpdateProfit]") value Net_Profit (=Marketing_Budget+Sales_Level);
For more information about DPL programs, See Writing DPL Programs.
Versions: DPL Professional, DPL Enterprise, DPL Portfolio
See Also