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 - activateprocs() activate resident procedures http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 activateprocs()     Activate resident procedures
------------------------------------------------------------------------------
 Declaration
   tsr.hdr

 Syntax
   proc activateprocs extern

 Arguments
   None.

 Return
   None.

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

   The application does not terminate and processing continues on the command
   or statement following the activateprocs() call. If you wish the
   application to terminate and stay resident, use the tsr() procedure.

 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_activateprocs
   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_activateprocs()
   endproc

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

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