Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - deactivateprocs() deactivate resident procedures http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 deactivateprocs()   Deactivate resident procedures
------------------------------------------------------------------------------
 Declaration
   tsr.hdr

 Syntax
   proc deactivateprocs extern

 Arguments
   None.

 Return
   None.

 Description
   The deactivateprocs() procedure de-activates all procedures installed via
   the timerentry() or procentry() functions.

   The quit command (or the implied quit in the final code of main())
   automatically calls deactivateprocs().

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   proc DispTime static
   // "Interrupt routine" which will display the time
   saverc()           // save the cursor position for later restore
   @ 4, 5 ?? time()   // display time
   restrc()           // restore the cursor position
   endpro
   
   proc Test_deactivateprocs
   vardef
      uint i
      uint uKey
   enddef
   
   clear
   cursoroff()
   
   // DispTime() is hooked in the timer interrupt chain
   timerentry( DispTime, 1, TSR_TIME_SECS, TSR_CALL_DOS )
   
   @ 10, 5 ?? "Press 'T' to start the time display"
   @ 11, 5 ?? "      'S' to stop  the time display"
   @ 12, 5 ?? "      Esc to quit  the demo."
   
   i := 0
   
   do while .t.
      @ 7, 0 ?? i
      i++
      uKey := inkey()
      do case
      case toupper( uKey ) == 'T'
         activateprocs()
      case toupper( uKey ) == 'S'
         deactivateprocs()
         @ 4, 5 ?? space( 8 )
      case uKey == K_ESC
         exit
      endcase
   enddo
   
   deactivateprocs()
   cursoron()
   clear
   endproc

   proc main
   Test_deactivateprocs()
   endproc

See Also: activateprocs() procentry() timerentry() tsr()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson