home *** CD-ROM | disk | FTP | other *** search
- Procedure Help;
- (*
-
- Thanks : Goes out to Cyrus Patel for his help with some
- intermediate program testing. Thanks!
-
- Author : Ken Isacson
- Version : 1.00
- Date : 4/15/1986
-
- Warning : This procedure must be run in MEMORY not .COM or .CHN !
-
- Before you run this program be sure that you have collected
- the data from HELPFIND.PAS. When you have finnished running
- that program then read INSTRUCTIONS FOR CORRECT USE and
- modify HelpOffSet with the integer that you selected from
- HELPFIND.PAS and change TERM to your terminal name.
-
- * * * * I N S T R U C T I O N S F O R C O R E C T U S E * * * * * * * *
-
- 1. While your pragram is loaded, type in `{$I HELP.INC}`
- after all variable declarations and before any procedures
- and the start of the main program.
-
- 2. Imediately after the BEGIN of the main program type
- in as a call to the included rename procedure
- `HELP;'
- `End.' (note that the end is optional but advisable).
-
- ***********************************************
- * Program Your_Code; *
- * *
- * Var X,Y,Z : Integer; *
- * *
- * {$I HELP.INC} *
- * *
- * Begin *
- * Help; *
- * End. <- this end. is opptional, but it *
- * . speed up the compiling time. *
- * . *
- * . *
- * (Main Code) *
- * . *
- * . *
- * . *
- * *
- * End. *
- ***********************************************
-
-
- 3. Be sure HELP.INC is on the logged drive.
-
- 4. Run the program that you have loaded, and HELP.INC
- will now be included.
-
- 5. Program control will now be in the HELP procedure.
- Continue to follow the instructions.
- When you Exit Help, the program will halt.
-
-
- 6. Remove `{$I HELP.INC}' from the beginning of your
- source code.
-
- 8. Remove `HELP;' and the End. (if you inserted it)
- from the main program block after BEGIN.
-
- 9. Continue to edit your code or whatever!
-
- * * * * * * * * * * * * * * E N J O Y ! * * * * * * * * * * * * * * * * * * *)
-
-
- Const
-
- (****************************************************************************)
- (* Stuff For You To Change From Here Until The Bottom Message *)
- (* *)
-
-
- Term : String[80] = 'Zenith H19/A'; {Change This One}
- HelpOffSet = ; {Set This One ie. HelpOffSet = 17229}
-
- (* *)
- (* If you DON'T have arrow keys on you keyboard then set HasArrows *)
- (* to Ture else change it false and don't worry about the *)
- (* NoArrowEsc value. If you have function keys then do the *)
- (* same for HasFunction and NoFunctionEsc. *)
- (* *)
- (* If you have arrows on your keyboard and they send escape and *)
- (* then a character, change NoArrowEsc to False Else change it to *)
- (* True also i.e. for left arrow Left = the decimal *)
- (* value of the letter. Do for Left...Down. The function keys *)
- (* are the same, so do for f1...f9. If you need more please *)
- (* feel free to add them, just follow the format here and at *)
- (* the Case Statements in the WhatKey procedure. *)
- (* *)
-
- HasArrow = True;
- NoEsc = False;
-
- Left = 68;
- Right = 67;
- Up = 65;
- Down = 66;
-
- HasFunction = True;
- NoFunctionEsc = False;
-
- f1 = 83;
- f2 = 84;
- f3 = 85;
- f4 = 86;
- f5 = 87;
- f6 = 74;
- f7 = 80;
- f8 = 81;
- f9 = 82;
-
- (* Leave The Rest Of This File Alone From This Point On ! *)
- (* Enjoy, Ken Isacson *)
- (****************************************************************)
-
-
- Info : Array[1..45] of String[29] =
- (
- 'Character left', ' Alternative',
- 'Character right', 'Word left',
- 'Word right', 'Line up',
- 'Line down', 'Scroll down',
- 'Scroll up', 'Page up',
- 'Page down', 'To left on line',
- 'To right on line', 'To top of page',
- 'To bottom of page', 'To top of file',
- 'To end of file', 'To begining of block',
- 'To end of block', 'To last cursor position',
- 'Insert mode on/off', 'Insert line',
- 'Delete line', 'Delete to end of line',
- 'Delete right word', 'Delete character under cursor',
- 'Delete left character', ' Alternative',
- 'Mark block begin', 'Mark block end',
- 'Mark single word', 'Hide/display block',
- 'Copy block', 'Move block',
- 'Delete block', 'Read block from disk',
- 'Write block to disk', 'End edit',
- 'Tab', 'Auto tab on/off',
- 'Restore line', 'Find',
- 'Find & replace', 'Repeat last find',
- 'Control character prefix'
- );
-
-
- Var Offset : Integer;
- P : Integer;
- Last : Integer;
- Command : Integer;
- Escape : Boolean;
- Section : Char;
- Label Finnish;
- Label Top;
-
- Procedure TopLabel;
-
- Begin
- GotoXY(21,1);
- LowVideo;
- Write ('Help.Inc');
- NormVideo;
- Write(' ');
- LowVideo;
- Write('By');
- Normvideo;
- Write(' ');
- LowVideo;
- Write(':');
- NormVideo;
- Write(' ');
- LowVideo;
- Write('Ken Isacson');
- NormVideo;
- Write(' ');
- LowVideo;
- Write('4/15/1986');
- GotoXY((80-Length(Term)) Div 2,3);
- Write(Term);
- NormVideo;
-
- End;
-
- Procedure WhatKey(Number : Integer);
-
- Label Skip;
-
- Begin
-
-
- Case Number of
- 8 : Write ('Back Space');
- 9 : Write ('Tab');
- 27 : Begin Write ('ESCape'); Escape := True; End;
- 10 : Write ('Line Feed');
- 13 : Write ('RETURN');
- 32 : Write ('SPACE');
- 33..126 : Write (Chr(Number));
- 127 : Write ('DELETE');
- 0..31 : Write ('CNTRL-',Chr(64+Number));
- End;
-
- If (HasArrow) and
- ( (Escape) or (NoEsc) ) and
- (Number in [Left, Right, Up, Down])
- Then
- Case Number of
- Left : Write (' or <--');
- Right : Write (' or -->');
- Up : Write (' or ^ (up arrow)');
- Down : Write (' or v (down arrow)');
- End;
-
- If (HasFunction) and
- ( (Escape or (NoFunctionEsc) ) and
- (Number in [ f1, f2, f3, f4, f5, f6, f7, f8, f9]))
- Then
- Case Number of
- f1,f2,f3,f4,f5: Write (' or Function Key ',Number-82);
- f6 : Write (' or ERASE Key');
- f7 : Write (' or BLUE Key');
- f8 : Write (' or RED Key');
- f9 : Write (' or WHITE Key');
- End;
-
- End;
-
- Procedure Instructions;
-
- Begin
- LowVideo;
- GotoXY(20,5); Write('C');
- GotoXY(20,7); Write('I');
- GotoXY(20,9); Write('B');
- GotoXY(20,11);Write('M');
- GotoXY(18,13);Write('ESC');
-
- NormVideo;
- GotoXY(21,5); Write('ursor Movements');
- GotoXY(21,7); Write('nsert & Delete');
- GotoXY(21,9); Write('lock Commands');
- GotoXY(21,11);Write('isc. Editing Commands');
- GotoXY(21,13);Write('ape Aborts');
-
- LowVideo;
- GotoXY(31,20);Write('Select Subtopic _',Chr(8));
- NormVideo;
- End;
-
- Begin
- Top:
- Clrscr;
- TopLabel;
- Instructions;
-
- Repeat
- Read(Kbd, Section);
- Section := Upcase(Section);
- Until Section in ['C', 'I', 'B', 'M', ^[];
- Write(Section);
- Delay(100);
-
- Case Section of
- 'C' : Begin Command := 1; Last := 21; End;
- 'I' : Begin Command := 21; Last := 29; End;
- 'B' : Begin Command := 29; Last := 38; End;
- 'M' : Begin Command := 38; Last := 46; End;
- ^[ : Goto Finnish;
- End;
-
- Offset := HelpOffSet;
-
- For P := 1 to Pred(Command) Do
- Offset := Offset + Succ(Mem[Offset]);
-
- ClrScr;
- GotoXY(1,3);
-
- Repeat
- Write(Info[Command]);
- Write(Copy(' ',1,40-Length(Info[Command])));
- Escape := False;
- For P := 1 to Mem[OffSet] Do
- Begin
- If Mem[Offset+P] = 255 then Write('Nothing') else WhatKey(Mem[Offset+P]);
- Write(' ');
- End;
- Writeln;
- Offset := Offset + Succ(Mem[Offset]);
- Command := Succ(Command);
- Until Command = last;
- LowVideo;
- GotoXY(34,24);
- Write('Hit Any Key');
- NormVideo;
- Repeat Until KeyPressed;
-
- goto Top;
-
- Finnish:
- ClrScr;
- halt;
- End;