home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / PASHELP.LBR / HELP.IQC / HELP.INC
Text File  |  2000-06-30  |  10KB  |  308 lines

  1. Procedure Help;
  2. (*
  3.  
  4.  Thanks  : Goes out to Cyrus Patel for his help with some
  5.            intermediate program testing.  Thanks!
  6.  
  7.  Author  : Ken Isacson
  8.  Version : 1.00
  9.  Date    : 4/15/1986
  10.  
  11.  Warning : This procedure must be run in MEMORY not .COM or .CHN !
  12.  
  13.  Before you run this program be sure that you have collected
  14.  the data from HELPFIND.PAS.  When you have finnished running
  15.  that program then read INSTRUCTIONS FOR CORRECT USE and
  16.  modify HelpOffSet with the integer that you selected from
  17.  HELPFIND.PAS and change TERM to your terminal name.
  18.  
  19. * * * * I N S T R U C T I O N S   F O R   C O R E C T   U S E * * * * * * * *
  20.  
  21.          1.  While your pragram is loaded, type in `{$I HELP.INC}`
  22.              after all variable declarations and before any procedures
  23.              and the start of the main program.
  24.  
  25.          2.  Imediately after the BEGIN of the main program type
  26.              in as a call to the included rename procedure
  27.              `HELP;'
  28.              `End.' (note that the end is optional but advisable).
  29.  
  30.               ***********************************************
  31.               * Program Your_Code;                          *
  32.               *                                             *
  33.               * Var X,Y,Z : Integer;                        *
  34.               *                                             *
  35.               * {$I HELP.INC}                               *
  36.               *                                             *
  37.               * Begin                                       *
  38.               *   Help;                                     *
  39.               *   End.  <- this end. is opptional, but it   *
  40.               *    .       speed up the compiling time.     *
  41.               *    .                                        *
  42.               *    .                                        *
  43.               *  (Main Code)                                *
  44.               *    .                                        *
  45.               *    .                                        *
  46.               *    .                                        *
  47.               *                                             *
  48.               * End.                                        *
  49.               ***********************************************
  50.  
  51.  
  52.          3.  Be sure HELP.INC is on the logged drive.
  53.  
  54.          4.  Run the program that you have loaded, and HELP.INC
  55.              will now be included.
  56.  
  57.          5.  Program control will now be in the HELP procedure.
  58.              Continue to follow the instructions.
  59.              When you Exit Help, the program will halt.
  60.  
  61.  
  62.          6.  Remove `{$I HELP.INC}' from the beginning of your
  63.              source code.
  64.  
  65.          8.  Remove `HELP;' and the End. (if you inserted it)
  66.              from the main program block after BEGIN.
  67.  
  68.          9.  Continue to edit your code or whatever!
  69.  
  70. * * * * * * * * * * * * * * E N J O Y ! * * * * * * * * * * * * * * * * * * *)
  71.  
  72.  
  73. Const
  74.  
  75. (****************************************************************************)
  76. (*       Stuff For You To Change From Here Until The Bottom Message         *)
  77. (*                                                                          *)
  78.  
  79.  
  80.    Term : String[80] = 'Zenith H19/A'; {Change This One}
  81.    HelpOffSet = ;                      {Set    This One ie. HelpOffSet = 17229}
  82.  
  83. (*                                                                          *)
  84. (*   If you DON'T have arrow keys on you keyboard then set HasArrows        *)
  85. (*   to Ture else change it false and don't worry about the                 *)
  86. (*   NoArrowEsc value.  If you have function keys then do the               *)
  87. (*   same for HasFunction and NoFunctionEsc.                                *)
  88. (*                                                                          *)
  89. (*   If you have arrows on your keyboard and they send escape and           *)
  90. (*   then a character, change NoArrowEsc to False Else change it to         *)
  91. (*   True also  i.e. for left arrow Left = the decimal                      *)
  92. (*   value of the letter.  Do for Left...Down.  The function keys           *)
  93. (*   are the same, so do for f1...f9.  If you need more please              *)
  94. (*   feel free to add them, just follow the format here and at              *)
  95. (*   the Case Statements in the WhatKey procedure.                          *)
  96. (*                                                                          *)
  97.  
  98.    HasArrow    = True;
  99.    NoEsc       = False;
  100.  
  101.    Left        = 68;
  102.    Right       = 67;
  103.    Up          = 65;
  104.    Down        = 66;
  105.  
  106.    HasFunction   = True;
  107.    NoFunctionEsc = False;
  108.  
  109.    f1    = 83;
  110.    f2    = 84;
  111.    f3    = 85;
  112.    f4    = 86;
  113.    f5    = 87;
  114.    f6    = 74;
  115.    f7    = 80;
  116.    f8    = 81;
  117.    f9    = 82;
  118.  
  119. (*    Leave The Rest Of This File Alone From This Point On !    *)
  120. (*               Enjoy, Ken Isacson                             *)
  121. (****************************************************************)
  122.  
  123.  
  124.    Info : Array[1..45] of String[29] =
  125. (
  126. 'Character left',                          '    Alternative',
  127. 'Character right',                         'Word left',
  128. 'Word right',                              'Line up',
  129. 'Line down',                               'Scroll down',
  130. 'Scroll up',                               'Page up',
  131. 'Page down',                               'To left on line',
  132. 'To right on line',                        'To top of page',
  133. 'To bottom of page',                       'To top of file',
  134. 'To end of file',                          'To begining of block',
  135. 'To end of block',                         'To last cursor position',
  136. 'Insert mode on/off',                      'Insert line',
  137. 'Delete line',                             'Delete to end of line',
  138. 'Delete right word',                       'Delete character under cursor',
  139. 'Delete left character',                   '       Alternative',
  140. 'Mark block begin',                        'Mark block end',
  141. 'Mark single word',                        'Hide/display block',
  142. 'Copy block',                              'Move block',
  143. 'Delete block',                            'Read block from disk',
  144. 'Write block to disk',                     'End edit',
  145. 'Tab',                                     'Auto tab on/off',
  146. 'Restore line',                            'Find',
  147. 'Find & replace',                          'Repeat last find',
  148. 'Control character prefix'
  149. );
  150.  
  151.  
  152. Var Offset  : Integer;
  153.     P       : Integer;
  154.     Last    : Integer;
  155.     Command : Integer;
  156.     Escape  : Boolean;
  157.     Section : Char;
  158.     Label     Finnish;
  159.     Label     Top;
  160.  
  161. Procedure TopLabel;
  162.  
  163. Begin
  164.    GotoXY(21,1);
  165.    LowVideo;
  166.    Write ('Help.Inc');
  167.    NormVideo;
  168.    Write('   ');
  169.    LowVideo;
  170.    Write('By');
  171.    Normvideo;
  172.    Write(' ');
  173.    LowVideo;
  174.    Write(':');
  175.    NormVideo;
  176.    Write(' ');
  177.    LowVideo;
  178.    Write('Ken Isacson');
  179.    NormVideo;
  180.    Write('  ');
  181.    LowVideo;
  182.    Write('4/15/1986');
  183.    GotoXY((80-Length(Term)) Div 2,3);
  184.    Write(Term);
  185.    NormVideo;
  186.  
  187. End;
  188.  
  189. Procedure WhatKey(Number : Integer);
  190.  
  191. Label Skip;
  192.  
  193. Begin
  194.  
  195.  
  196.       Case Number of
  197.       8       : Write ('Back Space');
  198.       9       : Write ('Tab');
  199.       27      : Begin Write ('ESCape'); Escape := True; End;
  200.       10      : Write ('Line Feed');
  201.       13      : Write ('RETURN');
  202.       32      : Write ('SPACE');
  203.       33..126 : Write (Chr(Number));
  204.       127     : Write ('DELETE');
  205.       0..31   : Write ('CNTRL-',Chr(64+Number));
  206.       End;
  207.  
  208.       If (HasArrow) and
  209.          ( (Escape) or (NoEsc) ) and
  210.          (Number in [Left, Right, Up, Down])
  211.          Then
  212.              Case Number of
  213.                   Left    : Write (' or <--');
  214.                   Right   : Write (' or -->');
  215.                   Up      : Write (' or ^ (up arrow)');
  216.                   Down    : Write (' or v (down arrow)');
  217.              End;
  218.  
  219.       If (HasFunction) and
  220.          ( (Escape or (NoFunctionEsc) ) and
  221.          (Number in [ f1, f2, f3, f4, f5, f6, f7, f8, f9]))
  222.          Then
  223.              Case Number of
  224. f1,f2,f3,f4,f5: Write (' or Function Key ',Number-82);
  225.       f6      : Write (' or ERASE Key');
  226.       f7      : Write (' or BLUE Key');
  227.       f8      : Write (' or RED Key');
  228.       f9      : Write (' or WHITE Key');
  229.       End;
  230.  
  231. End;
  232.  
  233. Procedure Instructions;
  234.  
  235. Begin
  236.    LowVideo;
  237.    GotoXY(20,5); Write('C');
  238.    GotoXY(20,7); Write('I');
  239.    GotoXY(20,9); Write('B');
  240.    GotoXY(20,11);Write('M');
  241.    GotoXY(18,13);Write('ESC');
  242.  
  243.    NormVideo;
  244.    GotoXY(21,5); Write('ursor Movements');
  245.    GotoXY(21,7); Write('nsert & Delete');
  246.    GotoXY(21,9); Write('lock Commands');
  247.    GotoXY(21,11);Write('isc. Editing Commands');
  248.    GotoXY(21,13);Write('ape Aborts');
  249.  
  250.    LowVideo;
  251.    GotoXY(31,20);Write('Select Subtopic _',Chr(8));
  252.    NormVideo;
  253. End;
  254.  
  255. Begin
  256.  Top:
  257.   Clrscr;
  258.   TopLabel;
  259.   Instructions;
  260.  
  261.   Repeat
  262.   Read(Kbd, Section);
  263.   Section := Upcase(Section);
  264.   Until Section in ['C', 'I', 'B', 'M', ^[];
  265.   Write(Section);
  266.   Delay(100);
  267.  
  268.   Case Section of
  269.   'C'  : Begin Command := 1;  Last := 21; End;
  270.   'I'  : Begin Command := 21; Last := 29; End;
  271.   'B'  : Begin Command := 29; Last := 38; End;
  272.   'M'  : Begin Command := 38; Last := 46; End;
  273.   ^[   : Goto Finnish;
  274.   End;
  275.  
  276.   Offset := HelpOffSet;
  277.  
  278.   For P := 1 to Pred(Command) Do
  279.          Offset := Offset + Succ(Mem[Offset]);
  280.  
  281.   ClrScr;
  282.   GotoXY(1,3);
  283.  
  284.   Repeat
  285.   Write(Info[Command]);
  286.   Write(Copy('                                        ',1,40-Length(Info[Command])));
  287.   Escape := False;
  288.   For P := 1 to Mem[OffSet] Do
  289.       Begin
  290.          If Mem[Offset+P] = 255 then Write('Nothing') else WhatKey(Mem[Offset+P]);
  291.          Write(' ');
  292.       End;
  293.   Writeln;
  294.   Offset := Offset + Succ(Mem[Offset]);
  295.   Command := Succ(Command);
  296.   Until Command = last;
  297.   LowVideo;
  298.   GotoXY(34,24);
  299.   Write('Hit Any Key');
  300.   NormVideo;
  301.   Repeat Until KeyPressed;
  302.  
  303.   goto Top;
  304.  
  305.  Finnish:
  306.  ClrScr;
  307.  halt;
  308. End;