Pathmaker Programming Guide

Modifying Requester/Server Pairs
Advanced Pathmaker Programming Topics
9–62 067868 Tandem Computers Incorporated
Coding a Select-and-Return Function
Some applications need to allow the end user to select a value from a list of values and
return the value to the previous screen. The Pathmaker values list screens, such as the
Requester Values List screen, provide this type of function.
You could modify the values list screen in Section 10 to add a select-and-return
function similar to the select-and-return function on the Pathmaker values list screens.
The following pages explain how to add a select-and-return function to the application
described in “Creating a NonStop SQL Pathmaker Application” in Section 10. Note
that this is a very simple version of a select-and-return function.
The list requester, SQL-ORDERS-LIST, finds the cursor position and returns the data
item corresponding to that cursor position to the calling requester, SQL-ORDER-
TAKER. SQL-ORDER-TAKER tests to see if it received any data from SQL-ORDERS-
LIST, and if it did, displays the value returned.
The requester copy library for SQL-ORDERS-LIST could look like this:
?SECTION USER-COMPILER-CMDS , TANDEM
?SYMBOLS
?SECTION USER-WS , TANDEM
01 CURSOR-FIELD-NUMBER PIC 9(02)
VALUE 0.
?SECTION USER-PRE-F10 , TANDEM
PERFORM FIND-CURSOR-POSITION.
IF CURSOR-FIELD-NUMBER > 0 AND CURSOR-FIELD-NUMBER < 10
PERFORM SELECT-FROM-LIST
ELSE
MOVE "Error finding cursor position, relist" TO
T9154-ADVISORY-MSG-TEXT
MOVE 0 TO CURSOR-FIELD-NUMBER
DISPLAY T9154-ADVICE-LINE OF T9154-MAIN-SCREEN
MOVE "Y" TO T9154-USER-ERROR-SW.
FIND-CURSOR-POSITION.
PERFORM 0900-BUILD-CURSOR-POSITION
MOVE T9154-SUBSCRIPT OF T9154-CURSOR-POSITION
TO CURSOR-FIELD-NUMBER.
SELECT-FROM-LIST.
MOVE REFERENCE-NUMBER OF ORDERS-LIST-ARRAY OF
ORDER-LIST-CONTEXT (CURSOR-FIELD-NUMBER) TO
CURRENT-KEY OF ORDER-LIST-CONTEXT
MOVE 2 TO T9154-REASON-CODE.