Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 50
Coding the Requester Program
! Open $SER2, create it if it does not already exist:
SERVER^NAME ':=' "$SER2" -> @S^PTR;
SERVERLEN := @S^PTR '-' @SERVER^NAME;
OBJECT^FILE ':=' "=SER2" -> @S^PTR;
OBJFILELEN := @S^PTR '-' @OBJECT^FILE;
CALL CREATE^AND^OPEN^SERVER(SERV2^NUM,OBJECT^FILE,
OBJFILELEN,SERVER^NAME,SERVERLEN);
! Open $SER3, create it if it does not already exist:
SERVER^NAME ':=' "$SER3" -> @S^PTR;
SERVERLEN := @S^PTR '-' @SERVER^NAME;
OBJECT^FILE ':=' "=SER3" -> @S^PTR;
OBJFILELEN := @S^PTR '-' @OBJECT^FILE;
CALL CREATE^AND^OPEN^SERVER(SERV3^NUM,OBJECT^FILE,
OBJFILELEN,SERVER^NAME,SERVERLEN);
END;
!------------------------------------------------------------
! This is the main procedure. It calls the INIT procedure to
! initialize and then goes into a loop calling GET^COMMAND
! to get the next user request and then calls a procedure
! to carry out the selected request.
!------------------------------------------------------------
PROC REQUESTER MAIN;
BEGIN
STRING CMD;
! Perform initialization:
CALL INIT;
! Loop indefinitely until user selects function "x":
WHILE 1 DO
BEGIN
! Prompt for the next command:
CMD := GET^COMMAND;