******************************************************************
*  FOR1.FOR                                                      *
*                                                                *
*  Short example of calling mouse functions from FORTRAN 4.1     *
*                                                                *
*  Compile using large model (default), and link with MOUSE.LIB  *
*  Example:   fl /FPc for1.for -link mouse                       *
******************************************************************

      PROGRAM FOR1

      INTEGER*2 M1, M2, M3, M4

* Display short message for user
      WRITE (*,*) 'Press either mouse button to quit'

* Mouse Reset and Status
      M1 = 0
      CALL MOUSEL (M1, M2, M3, M4)

* Show Cursor
      M1 = 1
      CALL MOUSEL (M1, M2, M3, M4)

 100  CONTINUE

* Get Button Status and Mouse Position
      M1 = 3
      CALL MOUSEL (M1, M2, M3, M4)

* Loop until either button is pressed
      M2 = MOD(M2, 4)
      IF (M2 .EQ. 0) GOTO 100

* Mouse Reset and Status
      M1 = 0
      CALL MOUSEL (M1, M2, M3, M4)

      STOP
      END
