* REPORT.CMD
* RLS
* MAR 86
* dBASE SHOPPER
SET TALK OFF
SET EJECT OFF
STORE 'N' TO op:quit
DO WHILE op:quit = 'N'
STORE t TO notready
DO WHILE notready
ERASE
SET INTENSITY OFF
RESTORE FROM GRAPHICS ADDITIVE
@  2,1 SAY gr:on
@  3, 1 SAY gr:ltc + gr:line
@  4, 1 SAY gr:vert
@  5, 1 SAY gr:vert
@  6, 1 SAY gr:vert
@  7, 1 SAY gr:vert
@  8, 1 SAY gr:vert
@  9, 1 SAY gr:lmid + gr:line
@ 10, 1 SAY gr:vert
@ 11, 1 SAY gr:vert
@ 12, 1 SAY gr:vert
@ 13, 1 SAY gr:vert
@ 14, 1 SAY gr:vert 
@ 15, 1 SAY gr:vert 
@ 16, 1 SAY gr:vert 
@ 17, 1 SAY gr:vert 
@ 18, 1 SAY gr:vert 
@ 19, 1 SAY gr:vert 
@ 20, 1 SAY gr:vert 
@ 21, 1 SAY gr:lbc + gr:line
@  9,30 SAY gr:umid
@ 10,30 SAY gr:vert
@ 11,30 SAY gr:vert
@ 12,30 SAY gr:vert
@ 13,30 SAY gr:vert
@ 14,30 SAY gr:vert
@ 15,30 SAY gr:vert
@ 16,30 SAY gr:vert
@ 17,30 SAY gr:vert
@ 18,30 SAY gr:vert
@ 19,30 SAY gr:vert
@ 20,30 SAY gr:vert
@ 21,30 SAY gr:bmid
@ 21,79 SAY gr:rbc
@ 20,79 SAY gr:vert
@ 19,79 SAY gr:vert
@ 18,79 SAY gr:vert
@ 17,79 SAY gr:vert
@ 16,79 SAY gr:vert
@ 15,79 SAY gr:vert
@ 14,79 SAY gr:vert
@ 13,79 SAY gr:vert
@ 12,79 SAY gr:vert
@ 11,79 SAY gr:vert
@ 10,79 SAY gr:vert
@  9,79 SAY gr:rmid
@  8,79 SAY gr:vert
@  7,79 SAY gr:vert
@  6,79 SAY gr:vert
@  5,79 SAY gr:vert
@  4,79 SAY gr:vert
@  3,79 SAY gr:rtc
@ 22,1 SAY gr:off
RELEASE ALL LIKE gr:*
@  6,10 SAY "  d B A S E   S H O P P E R   R E P O R T   O P T I O N S"
STORE "S" TO op:out
STORE "                                " TO op:title
STORE "Y" TO op:kind
STORE "P" TO op:scope
SET INTENSITY ON
@ 11,5 SAY "OUTPUT:"
@ 13,5 SAY "                      To"
@ 15,5 SAY "                   Title"
@ 16,5 SAY "                   Scope"
@ 17,5 SAY "                By aisle"
@ 20,5 SAY "                    QUIT"
SET INTENSITY OFF
@ 13,33 GET op:out PICTURE "!"
@ 15,33 GET op:title
@ 16,33 GET op:scope PICTURE "!"
@ 17,33 GET op:kind PICTURE "!" 
@ 20,33 GET op:quit PICTURE "!" 
SET INTENSITY ON
@ 13,40 SAY "<P>rinter or <S>creen"
@ 16,40 SAY "<P>urchase items or <E>verything"
@ 17,40 SAY "<Y>es or <N>o"
@ 20,40 SAY "<Y>es or <N>o"
SET INTENSITY OFF
READ
CLEAR GETS
IF op:quit # 'N'
  RELEASE ALL LIKE op:*
  RELEASE notready, m:rep, m:delim
  RETURN
ENDIF
IF op:scope = "P" .OR. op:scope = "E"
  IF op:out = "P" .OR. op:out = "S"
    IF op:kind = "Y" .OR. op:kind = "N"
      STORE f TO notready
    ELSE
      LOOP
    ENDIF
   ELSE
    LOOP
  ENDIF
 ENDIF
ENDDO notready

STORE "REPORT FORM STANDARD PLAIN " TO m:rep
STORE "FOR " TO m:delim
IF op:scope = "P"
  STORE m:rep + " FOR BUY " TO m:rep
ENDIF
IF op:kind = "Y"
  USE grocery&gs INDEX aisle&gs
ELSE
  USE grocery&gs INDEX item&gs
ENDIF
IF op:out = "P"
  ERASE
  @ 10, 10 SAY "GET PRINTER READY"
  WAIT
  SET PRINT ON
ENDIF
SET EJECT OFF
SET EXACT OFF
ERASE
?
? "                        &op:title "
? "         &mstrname" + "                  "+tdate
?
?
&M:REP
SET PRINT OFF
SET CONSOLE OFF
WAIT
SET CONSOLE ON
ENDDO
RETURN
