*    BYMAIL.CMD  -MAIN PROGRAM
*  DATABASE NAME IS   BYMAIL
*  DATABASE IS KEYED
SET TALK OFF
SET FORMAT TO SCREEN
SELECT PRIMARY
STORE FILE('BYMAIL.NDX') TO MQ:NDX
IF .NOT. MQ:NDX
 DO BYMAIL.GO
 ERASE
 @ 21,10 SAY  ' FILE IS NOW BEING INDEXED '
ENDIF
USE BYMAIL  INDEX  BYMAIL
STORE T TO MQ:MORE
DO WHILE MQ:MORE
 ERASE
@ 5,27 SAY '+--------------------+'
@ 6,27 SAY  '! SYSTEM:'
@ 6,37 SAY  'BYMAIL'
@ 6,48 SAY  '!'
@ 7,27 SAY  '!  FILE:'
@ 7,36 SAY  'BYMAIL'
@ 7,48 SAY  '!'
@ 8,11 SAY  '+---------------+--------------------+---------------+'
@ 9,11 SAY  '!                 PLEASE CHOOSE ONE:'
@ 9,64 SAY  '!'
@ 10,11 SAY  '!'
@ 10,26 SAY  'A to ADD data'
@ 10,64 SAY  '!'
@ 11,11 SAY  '!'
@ 11,26 SAY  'G to GET/EDIT data'
@ 11,64 SAY  '!'
@ 12,11 SAY  '!'
@ 12,26 SAY  'R to RUN report'
@ 12,64 SAY  '!'
@ 13,11 SAY  '!'
@ 13,26 SAY  'W to make WordStar Connection'
@ 13,64 SAY  '!'
@ 14,11 SAY  '!'
@ 14,26 SAY  'L to print mailing LABELS/forms'
@ 14,64 SAY  '!'
@ 15,11 SAY  '!'
@ 15,26 SAY  'I to INDEX database'
@ 15,64 SAY  '!'
@ 16,11 SAY  '!'
@ 16,64 SAY  '!'
@ 17,11 SAY  '!              Q to QUIT (exit to CP/M)'
@ 17,64 SAY  '!'
@ 18,11 SAY  '+----------------------------------------------------+'
 @ 21,10 SAY  '                                '
 SET CONSOLE OFF
 WAIT TO MQ:COMMAND
 SET CONSOLE ON
 IF !(MQ:COMMAND)= 'A'
    DO BYMAIL.ADD
 ELSE
 IF !(MQ:COMMAND)= 'G'
    DO BYMAIL.GET
ELSE
 IF !(MQ:COMMAND)='R'
    DO BYMAIL.RPT
ELSE
 IF !(MQ:COMMAND)='W'
    DO BYMAIL.WS
ELSE
 IF !(MQ:COMMAND)='L'
    DO BYMAIL.LBL
ELSE
 IF !(MQ:COMMAND)='I'
    @ 21,10 SAY  ' FILE IS NOW BEING INDEXED '
    DO BYMAIL.GO
ELSE
 IF !(MQ:COMMAND)='Q'
    QUIT
    ENDIF QUIT
    ENDIF GO
    ENDIF LABEL
    ENDIF WS
    ENDIF REPORT
    ENDIF GET
    ENDIF ADD
ENDDO
RELEASE MQ:MORE,MQ:COMMAND,MQ:NDX
  