home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / intelmdsb / mdshlp.p80 < prev    next >
Text File  |  2020-01-01  |  4KB  |  163 lines

  1. $TITLE ('HELP MODULE')
  2. help$module:
  3.  
  4. /* COPYRIGHT (C) 1985, Trustees of Columbia University in the City of New */
  5. /* York.  Permission is granted to any individual or institution to use,  */
  6. /* copy, or redistribute this software so long as it is not sold for      */
  7. /* profit, provided this copyright notice is retained. /*
  8.  
  9. /* HELP: Display help information to the terminal user */
  10.  
  11. do;
  12. declare lf literally '0AH';
  13. declare cr literally '0DH';
  14. declare null literally '000H';
  15. declare crlf literally 'cr,lf,null';
  16.  
  17. declare escchar byte external;
  18.  
  19. print:    procedure(msg) external;
  20.     declare msg address;
  21. end print;
  22.  
  23. co: procedure(char) external;
  24.     declare char byte;
  25. end co;
  26.  
  27. ctl: procedure(char) byte external;
  28.     declare char byte;
  29. end ctl;
  30.  
  31. newline: procedure external; end newline;
  32.  
  33. token: procedure address external;
  34. end token;
  35.  
  36. varcmp:    procedure (s1, s2) byte external;
  37.     declare (s1,s2) address;
  38. end varcmp;
  39.  
  40. upcase: procedure (addr) external;
  41.     declare addr address;
  42. end upcase;
  43.  
  44. /* Display help for the BYE command */
  45. byehelp:    procedure external;
  46. end byehelp;
  47.  
  48. /* Display help for the CONNECT command */
  49. conhelp:    procedure external;
  50. end conhelp;
  51.  
  52. /* Display help for the EXIT command */
  53. exhelp:    procedure external;
  54. end exhelp;
  55.  
  56. /* Display help for the FINISH command */
  57. finhelp:    procedure external;
  58. end finhelp;
  59.  
  60. /* Display help for the GET command */
  61. gethelp:    procedure external;
  62. end gethelp;
  63.  
  64. /* Display help for the HELP command */
  65. helphelp:procedure;
  66.     call print(.('\HELP\\$'));
  67.     call print(.('  The HELP command offers help about Kermit commands $'));
  68.     call print(.('and related information.\\$'));
  69.     call print(.('Syntax:\\$'));
  70.     call print(.('    HELP [topic]\\$'));
  71.     call print(.('If the HELP command is entered without an operand, $'));
  72.     call print(.('a list of topics\$'));
  73.     call print(.('will be displayed.\\$'));
  74. end helphelp;
  75.  
  76. /* Display help for the LOGOUT command */
  77. loghelp:    procedure external;
  78. end loghelp;
  79.  
  80. /* Display help for the RECEIVE command */
  81. rechelp:    procedure external;
  82. end rechelp;
  83.  
  84. /* Display help for the SEND command */
  85. senhelp:    procedure external;
  86. end senhelp;
  87.  
  88. /* Display help for the SET command */
  89. sethelp:    procedure external;
  90. end sethelp;
  91.  
  92. /* Display help for the SHOW command */
  93. shohelp:    procedure external;
  94. end shohelp;
  95.  
  96. /* Display help for the TAKE command */
  97. takehelp:    procedure external;
  98. end takehelp;
  99.  
  100. /* Display help on Kermit syntax */
  101. synhelp:    procedure;
  102.     call print(.('\ISIS Kermit syntax uses the following rules:\\$'));
  103.     call print(.('Kermit commands can be entered in any combination $'));
  104.     call print(.('of upper and lower case.\$'));
  105.     call print(.('A command keyword can be shortened to as few $'));
  106.     call print(.('characters as are necessary\$'));
  107.     call print(.('to distinguish it from other keywords.\\$'));
  108. end synhelp; 
  109.  
  110. /* Give general help about HELP */
  111. gen$help:    procedure;
  112.     call print(.('\ISIS-KERMIT has help for the following $'));
  113.     call print(.('topics:\\$'));
  114.     call print(.('  BYE        CONNECT    EXIT       $'));
  115.     call print(.('FINISH     GET\$'));
  116.     call print(.('  HELP       LOGOUT     RECEIVE    $'));
  117.     call print(.('SEND       SET\$'));
  118.     call print(.('  SHOW       Syntax     TAKE\\$'));
  119.     call print(.('To ask for help on a specific topic, $'));
  120.     call print(.('enter "HELP topic".\\$'));
  121. end gen$help;
  122.  
  123. help:
  124.     procedure public;
  125.     declare tokptr address;
  126.  
  127.     tokptr = token;
  128.     if tokptr = 0 then call gen$help;    /* if no keyword, give help summary */
  129.     else
  130.       do;
  131.         call upcase(tokptr); /* Translate to upper case */
  132.         if (varcmp(tokptr,.('BYE',null)) >= 1) then call byehelp;
  133.         else
  134.         if (varcmp(tokptr,.('CONNECT',null)) >= 1) then call conhelp;
  135.         else
  136.         if (varcmp(tokptr,.('EXIT',null)) >= 1) then call exhelp;
  137.         else
  138.         if (varcmp(tokptr,.('FINISH',null)) >= 1) then call finhelp;
  139.         else
  140.         if (varcmp(tokptr,.('GET',null)) >= 1) then call gethelp;
  141.         else
  142.         if (varcmp(tokptr,.('HELP',null)) >= 1) then call helphelp;
  143.         else
  144.         if (varcmp(tokptr,.('LOGOUT',null)) >= 1) then call loghelp;
  145.         else
  146.         if (varcmp(tokptr,.('RECEIVE',null)) >= 1) then call rechelp;
  147.         else
  148.         if (varcmp(tokptr,.('SEND',null)) >= 3) then call senhelp;
  149.         else
  150.         if (varcmp(tokptr,.('SET',null)) >= 3) then call sethelp;
  151.         else
  152.         if (varcmp(tokptr,.('SHOW',null)) >= 2) then call shohelp;
  153.         else
  154.         if (varcmp(tokptr,.('SYNTAX',null)) >= 2) then call synhelp;
  155.         else
  156.         if (varcmp(tokptr,.('TAKE',null)) >= 1) then call takehelp;
  157.         else
  158.         call gen$help;
  159.       end;
  160. end help;
  161.  
  162. end help$module;
  163.