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 - chkinstalled() check if a tsr multiplex id exists in memory http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 chkinstalled()      Check if a TSR multiplex id exists in memory
------------------------------------------------------------------------------
 Declaration
   tsr.hdr

 Syntax
   func logical chkinstalled extern
   param value uint uMultiplexId

 Arguments
   uMultiplexId is the identifier associated with the TSR looked for.

 Return
   A logical indicating if the specified TSR is installed in memory.

 Description
   The chkinstalled() function returns .t. if a TSR with uMultiplexId
   is installed. A multiplex id is a unique number assigned to a TSR
   program. By using the multiplex id, you can verify whether or not a TSR
   program is installed.

   The chkinstalled() function does not set the multiplex id if it could
   not be found. Use tsrinstall() to install a multiplex id.

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

See Also: tsr() tsrinstall()

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