DDE support - Communicating with other applications-
  FAQs 
  < BACK TO QUESTIONS 
question
How do I make PowerTerm communicate with other application using DEE?
  
answer

PowerTerm supports DDE. DDE permits applications to communicate with each other.

A DDE connection between two applications requires that one will be a server and the other a client. The DDE server application waits for requests from DDE clients, and allows them to supply it with information or receive information.

For example: A spread sheet DDE server will let clients get data from cells and put data into cells of a file.

PowerTerm can be a DDE client application or a DDE server.

As a DDE server PowerTerm Uses the server name PTW with topic PSL. Any application can request it to execute commands and return the related return data.

A client application can access PowerTerm with the DDE EXECUTE command or the DDE REQUEST command, and an item which is any valid PSL commands separated with ";". The single DDE server PSL command is:

dde return value

After a DDE REQUEST commands are executed the, PowerTerm DDE server sends the value from the last dde return command executed in this request. If no dde return command executed it returns an empty answer. Examples for PowerTerm as a DDE server might be: - Sending information to the host. - Reading information from the emulation screen.

As a DDE client performs one of several dde operations, depending on option. The legal options are:

  1. dde initiate applicationName topicName Connects to the applicationName DDE server with topicName. Returns a conversation id for use with successive dde commands.
  2. dde execute convId command Executes a server command. Return an empty string.
  3. dde request convId item Returns an item from the server.
  4. dde poke convId item value Changes an item of the server to the new value. Returns an empty string.
  5. dde terminate convId
Terminates a DDE conversation with the server.

Returns

Returns a value according to the option.

Example

  1. Initiates a DDE conversation with Excel for a file products.xls. Reads 3 numbers from the emulation screen. Puts them in three cells and gets a calculated result from a forth cell. Sends the result to the host computer.

    conv = [dde initiate EXCEL PRODUCTS.XLS]

    dde poke $conv R1C1 [screen-rect 1 1 10]

    dde poke $conv R2C1 [ screen-rect 2 1 10]

    dde poke $conv R3C1 [screen-rect 3 1 10]

    result = [dde request $conv R5C1]

    dde terminate $conv

    send $result

    Note: R5C1 indicates row 5 column 1.

  2. Initiate a DDE conversation with an other PowerTerm with is connected to another computer. Reads information from the screen (of the other host) and sends it to its own host.

    conv = [dde initiate PTW PSL]

    data = [dde request $conv

    dde return [screen 10 1 15 80]

    dde terminate $conv

    send $data

    Note: The command {dde return [screen 10 1 15 80]} is executed in the PowerTerm DDE server.




Top