SUBROUTINE CLOSE.FILE(CONTROL,DICT,FILENAME,ERROR)

****
*     This program used the complement to OPEN.FILE, closing any or all
* files.  There are four arguments to this subroutine discribed below:
*
* CONTROL     - This argument is for special functions of the CLOSE.FILE
*     subroutine.  Presently only one keyword is accepted, all others are
*     ignored:  "ALL" directs this subroutine to close all opened files.
* DICT        - To specify the dict portion of a file.
* FILENAME    - The specific file to close.
* ERROR       - Any error condition that may occur.
*
****
*                           R E V I S I O N   L O G
* PR#     WHEN     WHO        WHY
* ======= ======== ========== ===========================================
*
*
****

     COMMON /FILES/ FILENAMES, SIZE, FILE.VARIABLES(MAX)

     IF CONTROL EQ 'ALL' THEN
        FOR I = 1 TO SIZE
           CLOSE FILE.VARIABLES(I)
        NEXT I
        ERROR = ''
        RETURN
     END

     SEEK = DICT:'>':FILENAME
     LOCATE SEEK IN FILENAMES<1> SETTING PTR ELSE
        ERROR = 'File is not in the list of open files: ':SEEK
        RETURN
     END

     CLOSE FILE.VARIABLES(PTR)
