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 - tsrinstall() install a multiplex id number http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 tsrinstall()        Install a multiplex id number
------------------------------------------------------------------------------
 Declaration
   tsr.hdr

 Syntax
   func logical tsrinstall extern
   param value uint uMultiplexId

 Arguments
   uMultiplexId is the numeric identifier of the TSR.

 Return
   A logical indicating the success of operation.

 Description
   The tsrinstall() function installs a multiplex id number. This number
   is used to assign a unique number to a TSR program so that an owner can
   determine whether a particular TSR program is installed, and another
   process can determine whether any TSR program is installed.

   The multiplex id is managed by DOS, not by the Force runtime library. Not
   all TSR programs install a multiplex id number. It is good programming
   practice to do so.

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

See Also: tsr()

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