Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 39
Coding the Requester Program
! Copy reply from server into ORDER^REPLY structure:
ORDER^REPLY ':=' SBUFFER FOR $LEN(ORDER^REPLY);
! If stock depleted since checking, inform user and return:
IF ORDER^REPLY.QUANTITY^ON^HAND < 0 THEN
BEGIN
PRINT^BLANK;
PRINT^STR("Insufficient Stock for this Order ");
RETURN;
END;
! Prepare the order number for printing in blocks of
! 6 characters separated by spaces:
PRINT^BLANK;
START^LINE;
PUT^STR("Order Number is: ");
PUT^STR(ORDER^REPLY.ORDER^NUMBER[0] FOR 6);
PUT^STR(" ");
PUT^STR(ORDER^REPLY.ORDER^NUMBER[6] FOR 6);
PUT^STR(" ");
PUT^STR(ORDER^REPLY.ORDER^NUMBER[12] FOR 6);
PUT^STR(" ");
PUT^STR(ORDER^REPLY.ORDER^NUMBER[18] FOR 6);
PUT^STR(" ");
PUT^STR(ORDER^REPLY.ORDER^NUMBER[24] FOR 4);
! Print order number on the terminal:
PRINT^LINE;
END;