DDE Macro Command Application

The DDE Macro Command Application is a custom application for 1-2-3 for OS/2 
Release 1.1. It extends the Dynamic Data Exchange capabilities of 1-2-3 by 
allowing the user to create customized applications using Dynamic Data 
Exchange. 

	Insert the Custom Application Samples Disk in drive A and close the 
door.

	Type A: and press ENTER.

	Type cd DDE.

	Type copy *.* c:\123g and press ENTER.

If c:\123g is not the path and name of your 1-2-3 program directory, substitute 
the appropriate path. In order to use the application, you must put 
DDEMACRO.DLL in a directory listed in your LIBPATH for example; C:\123G.

The installation procedure copies the following files to your 1-2-3 program 
directory:





Files and Contents

DDEMEM.C

Memory management functions

DDEMACRO.DEF

Module definition file

DDEMACRO.MAK

NMAKE makefile

DDEMACRO.WG2

Worksheet illustrating DDE macros

DDEUSE.C

Implements {DDE_USE} macro keyword

DDEPOKE.C

Implements {DDE_POKE} macro keyword

DDEERROR.C

Error management functions

DDEWND.C

DDE window management functions

DDETABLE.C

Implements {DDE_TABLE} macro keyword

DDEMACRO.C

Main module containing the library manager functions

DDEOPEN.C

Implements {DDE_OPEN} macro keyword

DDEEXEC.C

Implements {DDE_EXECUTE} macro keyword

DDEMACRO.H

Main header file

DDECLOSE.C

Implements {DDE_CLOSE} macro keyword

DDEMACRO.DLL

DDE macro application



Note-You can move DDEMACRO.WG2 to another directory, but the other files should 
remain in the 1-2-3 program directory.

In a worksheet, create a macro program that includes the following command:

{library-attach ddemacro}

After you execute the above macro command, all of the following DDE macro 
commands are available to you:

		{DDE-TABLE}

		{DDE-OPEN}

		{DDE-USE}

		{DDE-POKE}

		{DDE-EXECUTE}

		{DDE-CLOSE}

Each of these macros is described in the following sections.

Creates a two-column table of DDE applications and topics that are currently 
available.

{DDE-TABLE location}

location specifies the address or name of a cell or range where the table is 
created. Any data in location is overwritten by the table.

{DDE-OPEN}

Initiates a conversation with an OS/2 application, making that the current 
conversation. Optionally, enters in location the unique decimal identification 
number OS/2 assigns to the conversation. You can open more than one 
conversation using {DDE_OPEN}. OS/2 assigns a unique decimal identification 
number to each conversation.

{DDE-OPEN app-name,topic-name,[location]}

app-name is the name of an open OS/2 application that supports DDE. app-name is 
any text enclosed in " " (quotation marks), a 
formula that results in text, or the address or name of a cell that contains a 
label or formula that results in a label.

topic-name is the name of the application file to link to. topic-name is any 
text enclosed in " " (quotation marks), a formula that results in text, or the 
address or name of a cell that contains a label or formula that results in a 
label.

location (optional) specifies the address or name of a cell or range. If you 
specify a range, 1-2-3 enters the identification number in the first cell of 
the range. If the attempted conversation fails, the identification number is 
zero.

You must start an application before using {DDE-OPEN}. You can start an 
application either with the OS/2 Program Manager or with the {SYSTEM -start 
app"} command.

You can use more than one {DDE-OPEN} command in a macro. To make a particular 
conversation current, use {DDE-USE}.

You should include the location argument if you plan to use more than one 
{DDE-OPEN} command in a macro.

{DDE-USE}
{DDE-CLOSE}

Makes the conversation specified by conversation-number the current 
conversation.

{DDE-USE conversation-number}

conversation-number is the unique identification number OS/2 
assigns to the conversation. If you use the optional location argu-ment in 
{DDE-OPEN}, 1-2-3 enters the identification number in the 
worksheet.

{DDE-USE} returns an error if conversation-number is invalid or refers to a 
terminated conversation.

You can open more than one conversation in a macro. To make a particular 
conversation current, use {DDE-USE}.

Sends a range of data to a server application during the current conversation.

{DDE-POKE range,item-name,[format]}

range is the address or name of the range that contains the data you want to 
send to the server application. If the range is three dimensional, only data 
from the first sheet is used.

item-name is the name of the topic item to link to. This is the item in the 
application file whose data you want transferred through the link. item-name is 
text enclosed in " " (quotation marks), a formula that results in text, or the 
address or name of a cell that contains a label or formula that results in a 
label.

format (optional) specifies one of the Clipboard formats (for example: Text, 
Metafile or Bitmap). In this implementation, Clipboard Text format is always 
used. format is any text enclosed in " " (quotation marks), a formula that 
results in text, or the address or name of a cell that contains a label or 
formula that results in a label. 

Some OS/2 applications that support DDE as servers do not support {DDE-POKE} 
functionality. See your application's documentation to find out what level of 
DDE server support the application provides.

Sends a command to an application.

{DDE-EXECUTE execute-string}

execute-string represents any command from the application, including macros. 
execute-string is any text enclosed in " " (quotation marks), a formula that 
results in text, or the address or name of a cell that contains a label or 
formula that results in a label.

{DDE-EXECUTE} returns an error if no conversation is open.

Terminates the current conversation with an OS/2 application.

{DDE-CLOSE}

If no conversation is open, or if multiple conversations are open but none is 
the current conversation, {DDE-CLOSE} does nothing.

{DDE-OPEN}
{DDE-USE}

