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 - unloadtsr() remove a tsr application from memory http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 unloadtsr()         Remove a TSR application from memory
------------------------------------------------------------------------------
 Declaration
   tsr.hdr

 Syntax
   proc unloadtsr extern

 Arguments
   None.

 Return
   None.

 Description
   The unloadtsr() procedure removes a TSR application from memory. The
   unloadtsr() call must exist within the same program that made the
   call to the tsr() function.

   Memory will not be freed if there is another application above the TSR
   application.

 Example
   #define EXAMPLE_SYSTEM
   #include example.hdr

   #define ID_CLOCK 200
   
   proc Clock static
   @ 0, __max_col - 7 ?? time()         // display time in every second
   endproc
   
   proc Unload static
   unloadtsr()                          // unload TSR when Ctrl-Z pressed
   endproc
   
   proc Test_unloadtsr
   if .not. chkinstalled( ID_CLOCK )    // check if already loaded
      if tsrinstall( ID_CLOCK )         // install multiplex ID
         if procentry( Unload, "<Ctrl><Z>", TSR_CALL_ANY ) // install unloader
            if timerentry( Clock, 1, TSR_TIME_SECS, TSR_CALL_ANY ) // install
               ? "TSR clock installed. Press Ctrl-Z to unload."
               tsr( 1024 )              // terminate and stay resident
            endif
         endif
      else
         ? "TSR clock could not be loaded"
      endif
   else
      ? "TSR clock already loaded"
   endif
   endproc

   proc main
   Test_unloadtsr()
   endproc

See Also: tsr() tsrinstall()

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