Documentation

#DDE

DDE

Syntax: #DDE server topic macro

This command allows you to communicate with an external program via Microsoft Windows Dynamic Data Exchange (DDE). You must consult the documentation of your external program to determine the syntax of its macros, and its defined topic names. The server name is usually the name of the program itself (without the .EXE). There are also built-in functions for DDE:

%dde(server,topic,item)

Communicates with the specified server and topic and returns the requested item as the value of the function call.
%ddepoke(server,topic,item,value)
sends value as the new item to the specified DDE server and topic.
%ddemacro(server,topic,macro)
does the same as this #DDE command and sends a DDE macro to the server.

If you open a DDE connection with the %ddeopen(server,topic) function, then you do not need to specify the server and topic in the other functions. This DDE connection is global to TeSSH and available in any window. When you are finished with a DDE connection, use the %ddeclose() function.

Note the TeSSH also acts as its own DDE server. The server name is TeSSH, the topic name is also TeSSH, and the only defined item name is data. Using a DDEPoke you can set data to any command string and cause all variables and function calls to be expanded. You can then use a DDE call to retrieve the resulting value of data. Using DDEMacro you can send a command string to TeSSH and cause it to be executed as if it were typed.

DDE examples

Since DDE is somewhat obscure, I have included a bunch of useful examples:

#DDE FIREFOX WWW_OpenURL "http://www.zuggsoft.com/TeSSH"

If you have Firefox, this command will send the specified URL and cause it to be opened.
#DDE TeSSH TeSSH "remove all;drop all"
Causes the indicated commands to be sent to TeSSH and executed! Watch out!
#CALL %dde(Excel,"TEST.XLS","R1C1")
Tells Microsoft Excel to load the spreadsheet TEST.XLS and returns the value of cell R1C1 (row 1, column 1)
#CALL %ddepoke(Excel,"TEST.XLS","R1C1",@tank)
Sends the value of the variable tank to Excel which overwrites R1C1 in spreadsheet TEST.XLS

Add comment

Login or register to post comments