*  PURCHASE.CMD
*  RLS
*  MARCH 1986
ERASE
SET COLON ON
USE grocery&gs INDEX item&gs
RESTORE FROM GRAPHICS ADDITIVE
@ 1,0 SAY gr:on
@ 1,1 SAY gr:ltc + gr:line
@ 2,1 SAY gr:vert
@ 3,1 SAY gr:vert
@ 4,1 SAY gr:vert
@ 5,1 SAY gr:vert
@ 6,1 SAY gr:vert
@ 7,1 SAY gr:lbc+gr:line
@ 7,79 SAY gr:rbc
@ 6,79 SAY gr:vert
@ 5,79 SAY gr:vert
@ 4,79 SAY gr:vert
@ 3,79 SAY gr:vert
@ 2,79 SAY gr:vert
@ 1,79 SAY gr:rtc
@ 8,1 SAY gr:off
RELEASE ALL LIKE gr:*
@ 3,10 SAY "       SELECT THE ITEMS YOU WISH TO PURCHASE FROM "
@ 5,30 SAY mstrname
SET INTENSITY ON
@ 8, 15 SAY "<X>-choose <CR>-next <B>-backup <S>-skip <Q>uit"
@ 10,7 SAY "Item"
@ 10,30 SAY "Comments"
@ 10,70 SAY "Coupons"
@ 11,1 SAY "________________________________________"
@ 11,40 SAY "_______________________________________"
SET INTENSITY OFF
STORE 12 TO cntr
STORE ' ' TO choice
DO WHILE choice # 'Q'
    @ cntr, 7 SAY item
    @ cntr, 30 SAY comments
    IF buy
     STORE "X" TO choice
    ENDIF 
    @ cntr, 3 GET choice PICTURE '!'
    @ $+1,0
    READ
    CLEAR GETS
    DO CASE
      CASE choice = 'B'
         SKIP -1
         STORE ' ' TO choice
      CASE choice = 'X'
         STORE " " TO choice
         REPLACE buy WITH t
         STORE comments TO mcomment
         STORE coupon TO mcoupon
         @ cntr, 30 GET mcomment
         @ cntr, 70 GET mcoupon
         READ
         REPLACE comments WITH mcomment
         REPLACE coupon WITH mcoupon
         SKIP
      CASE choice = 'S'
         @ cntr, 79
         ACCEPT '          how many? ' TO sno
         SKIP &sno
         RELEASE sno
         STORE ' ' TO choice
      OTHERWISE
         SKIP
      ENDCASE
      STORE 1 + cntr TO cntr
      IF cntr > 21
         STORE 12 TO cntr
      ENDIF                                 
      IF EOF
        GOTO TOP
        STORE 1 + cntr TO cntr
      ENDIF
     ENDDO choice
   RELEASE choice, cntr
   SET COLON OFF
   RETURN
