Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 29
Coding the Requester Program
!------------------------------------------------------------
! Procedure to process an order. The procedure puts together
! a request for an order from information entered in response
! to a series of prompts. After extensive checking, sends
! the request to the $SER2 server process which does the
! following:
!
! -- Updates the corresponding PART^REC
! -- Places an order record in the orders file
! -- Returns a reply record to this procedure
!
! The reply record contains an indication of the new stock
! level,and a 28-digit order number made up from a converted
! time stamp and the part number. This procedure prints the
! order number on the terminal.
!------------------------------------------------------------
PROC PROCESS^ORDER;
BEGIN
INT COUNT^READ;
INT BASE;
INT STATUS;
INT I;
! Blank the order-request message structure:
ORDER^REQUEST ':=' ($LEN(ORDER^REQUEST) / 2) * [" "];
!----------------------------
! Prompt for and process the
! part number.
!----------------------------
! Call the READ^PART procedure to prompt for the part number
! and find out if enough stock is on hand:
CALL READ^PART;