DDEExecute

Sends commands to a DDE server application.

Syntax:

DDEExecute (channel [, command string])

Parameters:

(i) channel: same integer that was returned by DDEInitiate.

(s) command: [optional] string one or more commands to be executed by the server app.

Returns:

(i) @TRUE if successful; @FALSE if unsuccessful.

 

Use the DDEInitiate function to obtain a channel number.

In order to use this function successfully, you will need appropriate documentation for the server application you wish to access, which must provide information on the DDE functions that it supports and the correct syntax to use.

 

Example:


Run("report.exe", "sales.dat") ;Run Report
channel = DDEInitiate("report", "YTD") ;Initialize DDE
If channel != 0 ;If DDE OK Execute DDE Command
   result = DDEExecute(channel, '[Act:p="ABCco", t=580.00]')
   DDETerminate(channel) ;Close DDE
   WinClose("Reports") ;Close Report
   If result == @FALSE
      Message("DDE Execute", "Failed")
   Else
      Message("DDE Execute", "Operation complete")
      Exit
   EndIf
Else
   Message("DDE operation unsuccessful", "Check your syntax")
EndIf
See Also:

DDEInitiate, DDEPoke, DDERequest, DDETerminate, DDETimeout