home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / mouse / lib / mouse / examples / forexamp.for < prev    next >
Encoding:
Text File  |  1988-08-11  |  1.4 KB  |  66 lines

  1. C        Mouse Function Calls and Microsoft FORTRAN
  2. C
  3. C        To Run :    FOR1 FOREXAMP;
  4. C            PAS2
  5. C            LINK FOREXAMP+SUBS,,,MOUSE;
  6. C                 or
  7. C            MAKE FOREXAMP.MAK
  8. C
  9.  
  10.        PROGRAM MTEST
  11.  
  12. C
  13. C      -- Mouse Library calls test in MS FORTRAN V3.31 --
  14. C
  15.  
  16.        INTEGER*2   M1, M2, M3, M4
  17.        EXTERNAL    GRAF, CHKDRV
  18.  
  19.  
  20. C      --  Call driver checking routine  --
  21.        CALL CHKDRV()
  22.  
  23. C      -- Mouse init call --
  24.        M1 = 0
  25.        CALL MOUSES(M1, M2, M3, M4)
  26.        IF ( M1 .EQ. 0 ) THEN
  27.          WRITE(*,*)' Microsoft Mouse NOT found'
  28.          STOP
  29.        ENDIF
  30.  
  31. C      -- Place Cursor in the center of the screen --
  32.        M1 = 4
  33.        M3 = 200
  34.        M4 = 100
  35.        CALL MOUSES(M1, M2, M3, M4)
  36.  
  37. C      -- Set minimum and maximum horizontal position --
  38.        M1 = 7
  39.        M3 = 150
  40.        M4 = 450
  41.        CALL MOUSES(M1, M2, M3, M4)
  42.  
  43. C      -- Set minimum and maximum vertical position --
  44.        M1 = 8
  45.        M3 = 50
  46.        M4 = 150
  47.        CALL MOUSES(M1, M2, M3, M4)
  48.  
  49.        CALL GRAF()
  50.  
  51.        WRITE(*,*) ' Graphics cursor limited to the screen center.'
  52.        WRITE(*,*) ' Press the left mouse button to EXIT.'
  53.  
  54.        M1 = 1
  55.        CALL MOUSES(M1, M2, M3, M4)
  56.  
  57.  
  58. C      -- Loop for left moue button pressed  --
  59.        M2 = 9999
  60.  100      M1 = 3
  61.       CALL MOUSES(M1, M2, M3, M4)
  62.        IF ( M2 .NE. 1 ) GOTO 100
  63.  
  64.        STOP
  65.        END
  66.