* - ADD.CMD
* - Called from main menu (MENU.CMD)
* - USES B:FOG.DBF
* - Prompts for entry of FOGHORN data base
*
USE B:FOG.DBF
ERASE
SET BELL OFF
DO WHILE T
   * - initialize variables to blank
   STORE '  ' TO DONE
   STORE '          ' TO MMAGAZINE
   STORE '        ' TO MDATE
   STORE '      ' TO MPAGE
   STORE '          ' TO MTOPIC
   STORE '                                                                                                                                                      ' TO MSUBJECT
   STORE '     'TO MRESERVED
   *
   * - display screen of data fields
   DO WHILE ! (DONE) <> 'Y'
      ERASE
      @  1, 0 SAY "FOGHORN DATA BASE PROGRAM"
      @  2, 0 SAY "HIT <CR> TO SKIP TO NEXT LINE"
      @  6, 0 SAY "       MAGAZINE " GET MMAGAZINE
      @  7, 0 SAY "           DATE " GET MDATE
      @  8, 0 SAY "           PAGE " GET MPAGE
      @  9, 0 SAY "          TOPIC " GET MTOPIC
      @ 10, 0 SAY "        SUBJECT " GET MSUBJECT
      @ 13, 0 SAY "       RESERVED " GET MRESERVED
      READ
      *
      * - test to return from this command file
      IF MMAGAZINE = " "
         RELEASE ALL
         RETURN
      ENDIF
      *
      ? "ARE ALL THE FIELDS CORRECT? (Y/N)"
      SET CONSOLE OFF
      WAIT TO DONE
      SET CONSOLE ON
   ENDDO
   *
   * - Add blank record to database
   APPEND BLANK
   *
   * - Substitute memory variables into database fields
   *
   REPLACE MAGAZINE WITH MMAGAZINE,DATE WITH MDATE
   REPLACE PAGE WITH MPAGE,TOPIC WITH MTOPIC,SUBJECT WITH MSUBJECT
   REPLACE RESERVED WITH MRESERVED
ENDDO
USE
RELEASE ALL
RETURN
