Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 37
Coding the Requester Program
! If any of the last five characters of the zip code is
! nonnumeric, reenter the zip code:
I := 2;
WHILE I < 7 DO
BEGIN
IF SBUFFER[I] < "0" OR SBUFFER[I] > "9" THEN
BEGIN
PRINT^BLANK;
PRINT^STR("Last Five Characters Must Be Numeric");
PRINT^STR("Please Enter Numeric Characters ");
GOTO REPEAT^ZIP;
END;
I := I + 1;
END;
! Put zip code in order-request message:
ORDER^REQUEST.ZIP ':=' SBUFFER[0] FOR COUNT^READ;
!-------------------------------
! Prompt for and process the
! customer's credit card number
!-------------------------------
! Repeat until valid credit-card number entered:
REPEAT^CCN:
! Prompt user for credit-card number:
PRINT^BLANK;
START^LINE;
PUT^STR("Enter Customer's Credit-Card Number: ");
CALL WRITEREADX(TERM^NUM,SBUFFER,@S^PTR '-' @SBUFFER,
BUFSIZE,COUNT^READ);
! If credit-card number not exactly 16 characters,
! prompt user to enter a valid credit-card number:
IF COUNT^READ <> 16 THEN
BEGIN
PRINT^BLANK;
PRINT^STR("Credit-Card Number Must be 16 Characters ");
PRINT^STR("Please Enter a Valid Credit-Card Number ");
END;