Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 31
Coding the Requester Program
! Check that there is enough stock on hand to satisfy the
! order:
IF ORDER^REQUEST.QTY^ORDERED > PART^REC.QUANTITY^ON^HAND
THEN
BEGIN
PRINT^BLANK;
START^LINE;
PUT^STR("Current Stock on Hand is Only ");
PUT^INT(PART^REC.QUANTITY^ON^HAND);
PRINT^LINE;
RETURN;
END;
!----------------------------
! Prompt for and process the
! customer's last name
!----------------------------
! Repeat until valid last name entered:
REPEAT^LASTNAME:
! Prompt user for last name:
PRINT^BLANK;
START^LINE;
PUT^STR("Enter Customer's Last Name: ");
CALL WRITEREADX(TERM^NUM,SBUFFER,
@S^PTR '-' @SBUFFER,BUFSIZE,COUNT^READ);
! If name is greater than 20 characters or less than one
! character, prompt user to enter a name of valid length:
IF COUNT^READ > 20 OR COUNT^READ < 1 THEN
BEGIN
PRINT^BLANK;
PRINT^STR("Last Name Must Be 1 to 20 Characters");
PRINT^STR("Please Enter a Valid Name ");
GOTO REPEAT^LASTNAME;
END;