PreviousNextIndex

DDE EXECUTE statement


(Windows only)

Instructs a dynamic data exchange (DDE) server application to execute one or more application commands.

This statement is supported only for backward compatibility. Use the Component Object Model (COM) instead.

Note: Does not apply to SpeedScript programming.
Syntax

DDE EXECUTE ddeid COMMAND string 
  [ TIME seconds ] 
  [ NO-ERROR ] 

ddeid
COMMAND string
TIME seconds
NO-ERROR
Example

The following fragment shows how to use the DDE EXECUTE statement. The procedure executes Microsoft Excel internally and opens a conversation for the Excel System topic. The System topic lets you execute Excel functions. This example uses the DDE EXECUTE statement to create a new Excel worksheet using the Excel new function:

DEFINE VARIABLE Sys      AS INTEGER NO-UNDO. /* DDE-ID to System topic */ 
DEFINE VARIABLE DDEframe AS HANDLE  NO-UNDO. /* DDE frame handle */ 
CREATE FRAME DDEframe.                       /* Create DDE frame */ 
/* DLL routine to execute an MS-Windows application. */ 
PROCEDURE WinExec EXTERNAL "kernel32.dll": 
  DEFINE INPUT PARAMETER ProgramName AS CHARACTER. 
  DEFINE INPUT PARAMETER Presentation AS LONG. 
END PROCEDURE. /* WinExec */ 
. . . 
/* Start Excel, open a DDE conversation with the Excel System topic, and create 
   a worksheet. */ 
RUN WinExec (INPUT "Excel /e", INPUT 2). /* 1=normal, 2=minimized */ 
DDE INITIATE Sys FRAME DDEframe APPLICATION "Excel" TOPIC "System". 
DDE EXECUTE Sys COMMAND "[new(1)]". 
. . . 

Notes
See also

DDE INITIATE statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex