* MENU1.CMD

SET TALK OFF
STORE "-----------------------------------" + ;
      "-----------------------------------" TO LINE
DO WHILE T
   RELEASE ALL LIKE M*
   set bell off
   set confirm on
   set colon off
   set talk off
   ERASE
   @  1, 5 SAY LINE
   @  2,15 SAY "Student Gradebook System Master Menu"
   @  4,15 SAY "Number          Description"
   SET INTENSITY OFF
   @  4,50 SAY "ACTIVE CLASS: " + FILE2
   SET INTENSITY ON
   @  5, 5 SAY LINE
   @  7,15 SAY "  1]        Update a Class File(sub-Menu)"
   @  8,15 SAY "  2]        Edit a Student's Record"
   @  9,15 SAY "  3]        Add a Grade to an Entire Class"
   @ 10,15 SAY "  4]        Print Class Reports(sub-Menu)"
   @ 11,15 SAY "  5]        Begin a New Grading Period"
   @ 12,15 SAY "  6]        Create a New Class"
   @ 13,15 say "  7]        Define an Assignment, Test or Project"
   @ 14,15 say "  8]        Copy Class Information to Another Drive"
   @ 15,15 SAY "  9]        Change Active Class"
   @ 16,15 SAY " 10]        Exit Student Gradebook"
   @ 17,15 SAY " 11]        QUIT DBASE II"
   STORE "  " TO SELECTION1
   STORE 0 TO SELECTION
   DO WHILE SELECTION<1 .OR. SELECTION> 11
      @ 19,12 SAY "Enter the desired choice --> " get selection1 ;
        pict"##"
      READ
      STORE VAL(SELECTION1) TO SELECTION
   ENDDO
   IF SELECTION = 1
      USE &FILE
      DO UPDATE
   ENDIF
   IF SELECTION = 2
      USE &FILE
      DO CHOOSE
   ENDIF
   IF SELECTION = 3
      USE &FILE
      DO ADDGRADE
   ENDIF
   IF SELECTION = 4
      DO PRINT
   ENDIF
   IF SELECTION = 5
      USE &FILE
      DO CREATE
   ENDIF
   IF SELECTION = 6
      DO NEW
   ENDIF
   IF SELECTION = 9
      DO GETCLASS
   ENDIF
   IF SELECTION = 10
      ERASE
      RETURN
   ENDIF
   IF SELECTION = 11
      QUIT
   ENDIF
   IF SELECTION = 7
      DO TOPIC
      USE &FILE
   ENDIF
   IF SELECTION = 8
      USE &FILE
      ERASE
      STORE F TO MDONE
      store " " to mdrive
      DO WHILE .NOT. MDONE
         @ 10,10 SAY "Which Drive (A, B, C or <Q>uit)? " get mdrive pict "!"
         READ
         ERASE
         if mdrive = "A" .or. mdrive = "B" .or. mdrive = "C"
            @ 12,30 SAY "COPYING CLASS FILE TO " + "&MDRIVE"
         endif
         IF MDRIVE = "A"
            RESET A:
            STORE "A:" + "&FILE2" TO MFILE
            COPY TO &MFILE
         ELSE
            IF MDRIVE = "B"
               RESET B:
               STORE "B:" + "&FILE2" TO MFILE
               COPY TO &MFILE
            ELSE
               IF MDRIVE = "C"
                  RESET C:
                  STORE "C:" + "&FILE2" TO MFILE
                  COPY TO &MFILE
               ELSE
                  IF MDRIVE = "Q"
                     STORE T TO MDONE
                  ELSE
                     LOOP
                  ENDIF Q
               ENDIF C
            ENDIF B
         ENDIF A
         STORE T TO MDONE
      ENDDO
      RELEASE ALL LIKE M*
   ENDIF
ENDDO

DO WHILE .NOT. MDONE