home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / tsr / tp_tsr / tsr_demo.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1989-02-02  |  1.9 KB  |  62 lines

  1.  
  2. {               (C) Copyright 1989 David Mutimer                      }
  3.  
  4.  
  5. {   This program is a very simple demo that is intended to show
  6.  
  7.     the operation of my TP_TSR unit.
  8.  
  9.     The PROCEDURES are :=
  10.  
  11.     set_tsr_scan_code( right_shift : boolean;
  12.                        left_shift  : boolean;
  13.                        control     : boolean;
  14.                        alt         : boolean;
  15.                        scan_char   : char;)  <= must be A..Z
  16.  
  17.        This sets up the key combination to activate your TSR
  18.  
  19.     install_tsr( your_tsr_vector  : pointer;
  20.                  installed_string : string;
  21.                  failed_string    : string;)
  22.  
  23.        This installs your TSR, if all goes well this routine will
  24.        write your INSTALLED_STRING to the screen and then exit to dos
  25.  
  26.          This routine will only return if an error is detected in the
  27.       parameters passed to it or it finds itself already installed.
  28.       If there is an error found a message will be written to the screen
  29.       If the routine detects it has been previously installed then your
  30.       FAILED_STRING will be written to the screen.                     }
  31.  
  32.  
  33.  
  34. {$M 2048,0,0 }          { heap max allocation to avoid using all memory }
  35.  
  36.  
  37.  
  38.  
  39. {$ifdef VER40}
  40.     uses crt,dos,tp4_tsr;
  41. {$endif}
  42.                                 { Use the the correct unit for your compiler }
  43. {$ifdef VER50}
  44.     uses crt,dos,tp5_tsr;
  45. {$endif}
  46.  
  47.  
  48. procedure Your_tsr;
  49. interrupt;               { Must be specified as interrupt }
  50.  begin
  51.    sound(1000);
  52.    delay(250);            { TSR consists of a short beep }
  53.    nosound;
  54.  end;
  55.  
  56. begin
  57.     { Set up the scan code as <alt> <left_shift> <Q> }
  58.     set_tsr_scan_code(false,true,false,true,'Q');
  59.  
  60.     install_tsr(@Your_tsr,'Installing the TP_TSR demo ','Demo already installed');
  61.     writeln('This line can only be executed if installation fails');
  62. end.