******************************************
*           FONE BOOK - FBMENU           *
*                                        *
*  This program was  written and placed  *
*   in the public domain by Don Mankin   *
*  MICRO-BASE  (916-971-1395)  300/1200  *
*   Copyright (c) 1983 Donald L Mankin   *
*    Please do not remove this notice    *
*                                        *
******************************************
SELECT PRIMARY
SET FORMAT TO SCREEN
SET INTENSITY ON
SET CONSOLE ON
SET TALK OFF
SET PRINT OFF
SET BELL OFF
IF.NOT.FILE('FBINDEX.NDX')
     DO FBINIT
ENDIF
USE FBDATA INDEX FBINDEX
IF.NOT.FILE('FBVAR.MEM')
     DO FBCONFIG
ENDIF
RESTORE FROM FBVAR
STORE '? CHR(7)' TO BEEP
DO WHILE T
     GOTO TOP
     ERASE
     ?'*** FONE BOOK ***'
     ?
     ?'<A>dd records'
     ?'<D>isplay records'
     ?'<L>ist by field'
     ?'<M>ailing Labels'
     ?'<P>ack records'
     ?'<Q>uit program'
     ?'<R>eport to print'
     ?'<S>ort records'
     ?
     ?'Select your option'
     ?'( USE UPPER CASE )'
     ?
     STORE ' 'TO TYPE
     ACCEPT TO TYPE
     STORE !(TYPE) TO TYPE
     DO CASE
          CASE TYPE='A'
               DO FBADDREC
          CASE TYPE='D'
               DO FBDSPREC
          CASE TYPE='L'
               DO FBLSTREC
          CASE TYPE='M'
               DO FBPRTLBL
          CASE TYPE='R'
               ERASE
               ?'*** PRINTING ***'
               SET PRINT ON
               SET CONSOLE OFF
               ? CHR(15)
               REPORT FORM FBLPRINT
               EJECT
               ? CHR(18)
               SET CONSOLE ON
          CASE TYPE='P'
               ERASE
               ?'*** PACKING RECORDS ***'
               ?
               PACK
          CASE TYPE='S'
               ERASE
               ?'*** SORTING BY LAST NAME ***'
               SORT ON LAST TO FBBACK
               USE FBBACK
               COPY ALL TO FBDATA
               USE FBDATA
               ?'***   INDEXING RECORDS   ***'
               INDEX ON LAST TO FBINDEX
          CASE TYPE='Q'
               SET TALK ON
               ERASE
               QUIT
          OTHERWISE
               &BEEP
               ?'** Invalid Entry **'
               STORE 1 TO XX
               DO WHILE XX<35
                    STORE XX+1 TO XX
               ENDDO WHILE XX<35
     ENDCASE
ENDDO WHILE T
          DO WHILE XX<35
                    STORE XX+1 TO XX
               ENDDO WHILE XX<35
     ENDCASE
ENDDO W