$INCLUDE: 'C:\FG\INTRFACE.FOR'

      PROGRAM MAIN

      INTEGER*2 MODE, STATUS
      INTEGER*1 HEADER(128)
      INTEGER*2 FG_PCXHEAD, FG_PCXMODE

      STATUS = FG_PCXHEAD('CORAL.PCX'//CHAR(0),HEADER)
      IF (STATUS .EQ. -1) THEN
         STOP 'Can''t open CORAL.PCX.'
      ELSE IF (STATUS .EQ. -2) THEN
         STOP 'CORAL.PCX is not a PCX file.'
      END IF

      MODE = FG_PCXMODE(HEADER)
      WRITE(6,10) MODE
10    FORMAT (' Optimal display mode is',I3,'.')

      STOP ' '
      END
