* TOPIC.CMD

set talk off
set colon off

set confirm ON
set bell off
use describe
GOTO TOP
erase

?
text
                           DESCRIBE AN ASSIGNMENT

     You are allowed to give a brief description to each of your assign-
ments, tests and projects.  The description must no longer than thirty
columns(letters).  Choose your topic and write in the description, and it
will be saved for later printouts.

        1.  Write a Description of an Assignment.
        2.  Write a Description of a Project.
        3.  Write a Description of a Test.
        4.  Print Out Your Descriptions.
        5.  Begin a New Grading Period/Erase Descriptions.
        6.  Quit and Return to the Menu.

endtext

* CHOOSE FIELD NAME

store f to done
do while .not. done
    store "  " to mnum
    store " " to man
    set confirm on
    @ 18,15 say "Your Choice -------> " get man pict "#"
    read
    if val(man) > 6 .or. val(man) < 1
        loop
    endif
    if val(man) = 6
        release done
        release all like m*
        return
    endif
    if val(man) = 4
        do prntopic
        release done
        release all like m*
        return
    endif
    if val(man) = 5
        do newtopic
        release done
        release all like m*
        RETURN
    endif

    @ 18,15 say "                                                      "

    store t to mloop
    do while mloop
        if man = "1"
            @ 18,15 say "Which Assignment -----> " get mnum pict "##"
            read
            if val(mnum) < 0 .or. val(mnum) > 15
                loop
            endif
        endif
        if man = "2"
            @ 18,15 say "Which Project --------> " get mnum pict "##"
            read
            if val(mnum) < 0 .or. val(mnum) > 5
                loop
            endif
        endif
        if man = "3"
            @ 18,15 say "Which Test -----------> " get mnum pict "##"
            read
            if val(mnum) <0 .or. val(mnum) > 5
                loop
            endif
        endif
        store f to mloop
    enddo

* SET FIELD NAME

    if man = "1" .and. val(mnum) < 10
        store "ASSN" + str(&mnum,1) to mtopic
    else
        if man = "1" .and. val(mnum) > 9
            store "ASSN" + str(&mnum,2) to mtopic
        else
            if man = "2"
                store "PROJ" + str(&mnum,1) to mtopic
            else
                if man = "3"
                    store "TEST" + str(&mnum,1) to mtopic
                endif 3
            endif 2
        endif 1/10
    endif 1/1

* FILL OUT THE DESCRIPTION

    store f to mdone
    store "                                        " to mfield
    do while .not. mdone
        @ 18,15 say "                                                  "
        @ 18,15 say "Give Your Description: "
        set confirm on
        set colon on
        @ 19,16 say " " get mfield
        read
        set colon off
        set confirm off
        store f to mdoit
        do while .not. mdoit
            store " " to manswer
            @ 21,30 say "Is This Correct? <Y/N> " get manswer pict "!"
            read
            if manswer = "Y"
                store t to mdone
                store t to mdoit
                @ 21, 30 say "                                       "
                @ 19,16 say "                                           "
            else
                if manswer = "N"
                    store t to mdoit
                    @ 20,30 say "                                       "
                else
                    loop
                endif
            endif
        enddo
        release mdoit
    enddo
    replace &mtopic with "&mfield"
enddo
set confirm on
release all like m*
release done
return

on must no longer than thirty
columns(letters).  Choose your topic and write in the description, and it
will be saved for later printouts.

        1.  Write a Description of an Assignment.
        2.  Write a Description