HP NonStop G-Series User Manual
Page 20

Client Programming
Introduction to the Tandem DDE Gateway
1–8
110838 Tandem Computers Incorporated
one, column one of a spreadsheet”) and its clipboard format must be identified. The
DDE server can then process the data item and return an acknowledgment to the DDE
client.
A DDE client can ask the DDE server to perform some processing by using the DDE
Execute function. The DDE client sends a command and parameters that will be
understood by the DDE server (such as “save the spreadsheet”).
A DDE client that needs data from a server can use the DDE Request function. Similar
to the DDE Poke, the needed data item is named. The format required by the DDE
client is also specified. It is the DDE server’s responsibility to locate the named data
item, render the data into the requested format, and then return the data .
Not all DDE clients and DDE servers support the same clipboard formats, and some
negotiation takes place on the data exchange formats. A DDE client might use the
DDE Poke function a number of times for the same data item, but with different
clipboard formats. The DDE client does this to hunt for a format that the DDE server
will accept. The DDE server just rejects (with a “nack”) the DDE Poke functions with
unsupported formats and the client tries another format. Similarly, a DDE Request
function from a DDE client might be rejected by a DDE server because the requested
format is not supported.
Again, the client hunts for a supported format. Generally, in higher level tools, such as
Microsoft Excel, this format hunting is automatic and no programming is necessary.
Client applications in languages such as Visual Basic and C are generally programmed
to DDE Poke and DDE Request only in formats known to be acceptable to the DDE
server being used.
When the DDE client has no more immediate use for the DDE server, the DDE
Terminate function is used to end the DDE conversation.
Client Programming
To explain the two different approaches to client programming, the Tandem requester-
server communication model is first described by an example Tandem Screen COBOL
(SCOBOL) requester; then the equivalent Tandem DDE Gateway client applications
are described.
Tandem Server
Communication Model
The following fragment of SCOBOL is from a program that includes a simple
transaction that requests information about an employee from a Tandem Pathway
server program.
DATA DIVISION.
01
READ-REQUEST-MESSAGE.
03
EMPLOYEE-NUMBER
PIC 9(4) COMP.
01
READ-REPLY-MESSAGE.
03
REPLY-CODE
PIC S9(4) COMP.
03
ERROR-MESSAGE
PIC X(76).
03
LAST-NAME
PIC X(20).
03
SALARY
PIC 9(6)V9(2) COMP.