Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 35
Coding the Requester Program
! Put street address in order-request message:
ORDER^REQUEST.ADDRESS ':=' SBUFFER[0] FOR COUNT^READ;
!----------------------------
! Prompt for and process the
! customer's city name
!----------------------------
! Repeat until valid city name entered:
REPEAT^CITY:
! Prompt user for city name:
PRINT^BLANK;
START^LINE;
PUT^STR("Enter City Name: ");
CALL WRITEREADX(TERM^NUM,SBUFFER,
@S^PTR '-' @SBUFFER,BUFSIZE,
COUNT^READ);
! If name is greater than 24 characters, prompt user to
! issue a shorter city name:
IF COUNT^READ > 24 OR COUNT^READ < 1 THEN
BEGIN
PRINT^BLANK;
PRINT^STR("City Name Must Be 1 To 24 Characters");
PRINT^STR("Please Enter a Valid city name");
GOTO REPEAT^CITY;
END;
! If city name contains nonalphabetic characters, prompt
! user to reenter city name:
I := 0;
WHILE I < COUNT^READ DO
BEGIN
IF SBUFFER[I] < "A" OR SBUFFER[I] > "z" OR
(SBUFFER[I] > "Z" AND SBUFFER[I] < "a") THEN
BEGIN
PRINT^BLANK;
PRINT^STR("City Name Must Be Alphabetic");
PRINT^STR("Please Enter an Alphabetic City Name");
GOTO REPEAT^CITY;
END;
I := I + 1;
END;
! Put city name in order-request message:
ORDER^REQUEST.CITY ':=' SBUFFER[0] FOR COUNT^READ;