HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)
Sample CPI-C Transaction Programs
Pseudocode
Chapter 4320
Pseudocode
This section contains the pseudocode for the transaction programs,
CSAMPLE1 and CSAMPLE2.
The sample programs are provided as csample1.c and csample2.c, in
the directory /opt/sna/samples.
CSAMPLE1 (Invoking Program)
The pseudocode for CSAMPLE1 (the invoking program) is as follows:
initialize
allocate
send data (data = filename)
do while no error and prompt not Q
receive
if data block received
display data block
else if permission to send received
get user prompt (F, B, or Q)
if prompt = F or B /* Not Q */
send data (data = prompt)
endif
endif
end do
deallocate
CSAMPLE2 (Invoked TP)
The pseudocode for CSAMPLE2 (the invoked TP) is as follows:
initialize
do while conversing
receive
if data received
if first time (data = filename)
open file
if file not found
deallocate
set conversing false
endif
else (data = prompt)
read and store prompt