
* Program..: MAINMENU.CMD
* Author...: Bob Stephens
* Date.....: March 1986
* Notes....: the dBASE SHOPPER is copyrighted material.  It may be freely
*            copied and distributed for non-profit purposes.
* Reserved.: select, selectnum
*
SET COLON OFF
RESTORE FROM GRAPHICS ADDITIVE
SET TALK OFF
SET INTENSITY OFF
ERASE
TEXT
                     o--o
                         \      dBASE SHOPPER
                          |---+---+---+---+---+---+
                          |   |   |   |   |   |   |
                          |---+---+---+---+---+---+
                          |   |   |   |   |   |   |
                          |-----------------------+
                          |
                          |
                          |
                          +---+---+---+---+---+---+
                          @@                     @@
                         @  @                   @  @
                          @@                     @@


ENDTEXT
@ 2,47 SAY gr:rvoff
@ 2,30 SAY gr:rvon
@ 20,30 SAY "Enter Today's Date:"
@ 21,46 SAY gr:rvoff
@ 21,32 SAY gr:rvon 
store T to NODATE
do while NODATE
store '        ' to date:rep
@ 21,36 get date:rep picture '99/99/99'
read
clear gets
store VAL($(date:rep,1,2)) to MMONTH
store VAL($(date:rep,4,2)) to MDAY
store VAL($(date:rep,7,2)) to MYEAR
if '.'$date:rep .OR. ' '$date:rep .OR. '+'$date:rep .OR. '-';
$date:rep .OR. MMONTH < 1 .OR. MMONTH > 12 .OR. MDAY <1 .OR.;
MDAY >31 .OR. MYEAR < 85
  @ 22, 10 say ' Your entry was not a valid date. Please try again.'
  SET CONSOLE OFF
  wait
  SET CONSOLE ON
  @ 22,0
else
  store date:rep to TDATE
  set DATE to &TDATE
  store F to NODATE
endif
enddo
@ 22,0
STORE 1 TO CNTR
DO WHILE cntr < 5
@ 12, 1 SAY "                         @                      @  "
@ 13, 1 SAY "                        @ @                    @ @ "
@ 14, 1 SAY "                        @@                     @@  "
@ 15,1 
@ 12, 1 SAY "                         @@                     @@  "
@ 13, 1 SAY "                        @  @                   @  @"
@ 14, 1 SAY "                         @@                     @@"
@ 15, 1
STORE 1 + cntr TO cntr 
ENDDO cntr
@ 8,38 SAY "by"
@ 9,33 SAY "Bob Stephens"
@ 22,1
SET CONSOLE OFF
WAIT
SET CONSOLE ON
RELEASE date:rep, mmonth, mday, myear, nodate, m1, m2, d1,d2,y1,y2
DO WHILE T
RESTORE FROM GRAPHICS ADDITIVE
ERASE
@ 1,0 SAY GR:ON
@  1, 0 SAY GR:LTC+GR:LINE
@  1,79 SAY GR:RTC
@  2, 0 SAY GR:VERT

@  2,79 SAY GR:VERT
@  3, 0 SAY GR:LMID+GR:LINE
@  3,79 SAY GR:RMID
@  4, 0 SAY GR:VERT
@  4,79 SAY GR:VERT
@  5, 0 SAY GR:VERT
@  5,79 SAY GR:VERT
@  6, 0 SAY GR:VERT
@  6,79 SAY GR:VERT
@  7, 0 SAY GR:VERT
@  7,79 SAY GR:VERT
@  8, 0 SAY GR:VERT
@  8,79 SAY GR:VERT
@  9, 0 SAY GR:VERT
@  9,79 SAY GR:VERT
@ 10, 0 SAY GR:VERT
@ 10,79 SAY GR:VERT
@ 11, 0 SAY GR:LBC+GR:LINE
@ 11,79 SAY GR:RBC
@ 12,1 SAY gr:off
@  2,18 SAY "d B A S E    S H O P P E R    O P T I O N S"
@  5,25 SAY " 0. exit"
@  6,25 SAY " 1. select items to purchase"
@  7,25 SAY " 2. reports"
@  8,25 SAY " 3. changes"
STORE  4 TO selectnum
DO WHILE selectnum < 0 .OR. selectnum >  3
   STORE " " TO select
   @ 11,33 SAY " select : : "
   @ 11,42 GET select PICTURE "#"
RELEASE ALL LIKE GR:*
   READ
   STORE VAL(select) TO selectnum
ENDDO

DO CASE
   CASE selectnum= 0
      SET COLON ON
      RETURN
   CASE selectnum= 1
      DO getgro
      DO purchase
   CASE selectnum= 2
      DO getgro
      DO report
   CASE selectnum= 3
STORE t TO mkchange
SET COLON OFF
DO WHILE mkchange
RESTORE FROM GRAPHICS ADDITIVE

ERASE
@ 1,0 SAY gr:on
@  1, 0 SAY GR:LTC+gr:line
@  1,79 SAY GR:RTC
@  2, 0 SAY GR:VERT

@  2,79 SAY GR:VERT
@  3, 0 SAY GR:LMID+gr:line
@  3,79 SAY GR:RMID
@  4, 0 SAY GR:VERT
@  4,79 SAY GR:VERT
@  5, 0 SAY GR:VERT
@  5,79 SAY GR:VERT
@  6, 0 SAY GR:VERT
@  6,79 SAY GR:VERT
@  7, 0 SAY GR:VERT
@  7,79 SAY GR:VERT
@  8, 0 SAY GR:VERT
@  8,79 SAY GR:VERT
@  9, 0 SAY GR:VERT
@  9,79 SAY GR:VERT
@ 10, 0 SAY GR:VERT
@ 10,79 SAY GR:VERT
@ 11, 0 SAY GR:VERT
@ 11,79 SAY GR:VERT
@ 12, 0 SAY GR:VERT
@ 12,79 SAY GR:VERT
@ 13, 0 SAY GR:LBC+gr:line
@ 13,79 SAY GR:RBC
@ 14,1 SAY gr:off
@  2,11 SAY "d B A S E    S H O P P E R    C H A N G E    O P T I O N S"
@  5,25 SAY " 0. exit"
@  6,25 SAY " 1. clear previous purchases"
@  7,25 SAY " 2. change item/aisles/comments"
@  8,25 SAY " 3. add or delete an item"
@  9,25 SAY " 4. add a store"
@ 10,25 SAY " 5. remove a store"
STORE  6 TO selectnum
DO WHILE selectnum < 0 .OR. selectnum >  5
   STORE " " TO select
   @ 13,33 SAY " select : : "
   @ 13,42 GET select PICTURE "#"
RELEASE ALL LIKE GR:*
   READ
   STORE VAL(select) TO selectnum
ENDDO

DO CASE
   CASE selectnum= 0
      SET COLON ON
      STORE f TO mkchange
   CASE selectnum= 1
      DO getgro
      DO clear
   CASE selectnum= 2
      DO getgro
      DO change 
   CASE selectnum= 3
      DO getgro
      DO additem
   CASE selectnum= 4
      DO addstore
   CASE selectnum= 5
      DO getgro
      DO remstore
ENDCASE
ENDDO mkchange
ENDCASE
ENDDO T
