Category : Pascal Source Code
Archive   : TPTSR.ZIP
Filename : TSR.SKL

Output of file : TSR.SKL contained in archive : TPTSR.ZIP
program Skeleton; { Use this code to cookbook your TSR program. }

{ You must define four procedures that are passed as parameters to }
{ MakeTSR(). I have named them here as: Startup, Popup, Wrapup, and }
{ OptionComm to suggest their functionality but you can name them }
{ any names you want. The procedure headers must, however, match }
{ the procedure type parameters in MakeTSR(), see }

uses crt, tsr, cmdln;

{$M 0,0,0} { Set to the minimum size tolerable to your program }

procedure Startup; { Called when TSR installed. }
var params : CmdLnParams;

{ The following code explains the tsr unit command line switches. }

writeln('Skeleton TSR');
writeln('Press P to popup.');
writeln('At the command line prompt type: ');
writeln(' Skeleton -r to remove the TSR from memory,');
writeln(' Skeleton -d to deactivate the TSR in memory,');
writeln(' Skeleton -a to activate TSR in memory,');
writeln(' Skeleton -m to force monochrome display,');
writeln(' Skeleton -c to force color display,');
writeln(' Skeleton -kcode code is scan code of hotkey,');
writeln(' Skeleton -sshift shift is shift state of hotkey,');
writeln(' Skeleton -p to popup TSR.');
writeln('Run hotkey.exe to determine code and shift.');

{ Add any additional options instructions here. }
{ Additional options are specified in the call to MakeTSR() below. }
{ Options issued while installing should be processed here. }
{ Options communicated to resident TSR are processed by OptionComm below. }
{ Psuedo code is presented below for adding "q" as an option. }
{ See cmdln.doc for details. }

writeln(' Skeleton -q an option for your application');
{ Use tsr.TSRandPopupOptions to specify options to CmdLnParams object. }
while (params.getOption <> #0) do begin
case params.optCh of
'r','R': ; { Processed by TSR unit. }
'a','A': ; { Processed by TSR unit. }
'd','D': ; { Processed by TSR unit. }
'm','M': ; { Processed by TSR unit. }
'c','C': ; { Processed by TSR unit. }
'H','h': ; { Processed by TSR unit. }
'p','P': ; { Processed by TSR unit. }
'?': ; { Processed by TSR unit. }
'q','Q': ; { Your application processes this one! }
while (params.paramNo <= ParamCount) do begin
writeln('Argument: ',ParamStr(params.paramNo));
{ Your application should process arguments here. }

{ Any initialization code for your program belongs here. }


procedure Popup; { Called when hotkey pressed. }

{ Place the code you want executed when the hotkey is pressed here. }

{ If your TSR is not prepared to popup in graphic modes then don't! }
if not CrtPlus.TxtScr.IsTextMode then

{ Use tsr.TSRcolor to determine color or monochrome operation, e.g. }
if TSRcolor then begin
else begin


procedure Wrapup; { Called when TSR removed from memory. }

{ Any cleanup code you want executed when the TSR is removed belongs here. }


procedure OptionComm(optCh: char; argSeg, argOfs : word); { See notes below. }
var StrPtr : ^string;
if optCh <> #0 then
write('Option: ',optCh,' ');
StrPtr := Ptr(argSeg, argOfs);
if length(StrPtr^) > 0 then
write('argument: ',StrPtr^);

{ Once resident, invoking your TSR with command line switches or arguments }
{ results in a call to this procedure. The code above demonstrates how to }
{ recover that information. See cmdln.doc for further information on }
{ specifying options. The additional options are specified in the call to }
{ MakeTSR() below. }



{ Additional options belong in first parameter: see cmdln.doc }


{ 25 and 8 are the scan code and shift state for P. }
{ Run hotkey.exe to find code and state for your hotkey choice. }


  3 Responses to “Category : Pascal Source Code
Archive   : TPTSR.ZIP
Filename : TSR.SKL

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: