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

      PROGRAM MAIN

      INTEGER*2 OLD_MODE
      INTEGER*2 PAGE_ADDR, PAGE_TYPE
      INTEGER*2 STATUS
      INTEGER*2 FG_ALLOCCMS, FG_FREEPAGE, FG_GETMODE

      OLD_MODE = FG_GETMODE()
      CALL FG_SETMODE(18)
      STATUS = FG_ALLOCCMS(2)
      CALL FG_GETENTRY(2,PAGE_ADDR,PAGE_TYPE)

      CALL FG_SETCOLOR(9)
      CALL FG_FILLPAGE
      CALL FG_SETCOLOR(15)
      CALL FG_BOX(0,639,0,479)
      CALL FG_WAITKEY

      CALL FG_COPYPAGE(0,2)
      CALL FG_SETMODE(OLD_MODE)
      CALL FG_CURSOR(0)
      CALL FG_SETCOLOR(15)
      CALL FG_TEXT('Press any key.',14)
      CALL FG_WAITKEY

      CALL FG_SETMODE(18)
      CALL FG_SETENTRY(2,PAGE_ADDR,PAGE_TYPE)
      CALL FG_COPYPAGE(2,0)
      CALL FG_WAITKEY

      STATUS = FG_FREEPAGE(2)
      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
      END
