home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 270.img / FORUM25C.ZIP / MYCOMMAN.PAS < prev    next >
Pascal/Delphi Source File  |  1988-12-27  |  3KB  |  96 lines

  1. {$R-,S-,I-,D-,V-,B-,N-,L- }
  2. {$O+}
  3.  
  4. (*******
  5. *
  6. * You may put your own Forum-PC command in this module.  It will be "J" from
  7. * the main menu.
  8. *
  9. * Here is a short example which illustrates how to use some of the Forum-PC
  10. * Procedures:
  11. *
  12. *   Procedure mycommand;
  13. *   VAR n,try,guess:integer;
  14. *   begin
  15. *     repeat
  16. *       writehdr ('Guess the Number');     { Write header }
  17. *       n:=random(100)+1;                  { Generate number 1 to 100 }
  18. *       try:=0;
  19. *       repeat
  20. *         try:=try+1;
  21. *         write ('Try #',try,': ');        { Write/Writeln send to the modem }
  22. *         getstr;
  23. *         guess:=valu(input);              { VALU converts string to number }
  24. *         if guess<n
  25. *           then writestr ('Too small!  Try a higher number!')
  26. *           else if guess>n
  27. *             then writestr ('Too big!  Try a lower number!')
  28. *       until guess=n;
  29. *       writestr ('');
  30. *       writeln ('You got it in ',try,' tries!');
  31. *       writestr ('Play again? *');        { * means wait for input }
  32. *     until not yes                        { YES tests input for Yes or No }
  33. *   end;
  34. *
  35. * Note: WRITESTR always writes a string to the modem, regardless if the person
  36. *       had just pressed space.  If the person presses space, WRITELN's will
  37. *       be ignored until a WRITESTR is called.
  38. *
  39. *       In addition, the following special characters are interpreted by
  40. *       WRITESTR (when they appear at the end of the string):
  41. *
  42. *       Char Example             Explanation
  43. *
  44. *       *    Yes or no? *        Get input, allow chaining
  45. *       &    Your name? &        Get input, no chaining; accept commas
  46. *       :    Two plus two is:    Print the colon and get input
  47. *
  48. * If this is thoroughly baffling, I suggest you study Pascal before attempting
  49. * to add your own command(s)!
  50. *
  51. *******)
  52.  
  53. unit mycomman;
  54.  
  55.  
  56. {/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
  57.  
  58. interface
  59.  
  60. uses crt,dos,
  61.      gentypes,configrt,modem,statret,gensubs,subs1,windows,subs2,textret,
  62.      mailret,userret,flags,mainr1,ansiedit,lineedit,chatstuf,
  63.      mainr2,overret1;   { that's everything! }
  64.  
  65. {/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
  66.  
  67.  
  68. Procedure mycommand;
  69.  
  70.  
  71. {/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
  72.  
  73. implementation
  74.  
  75. {/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
  76.  
  77.  
  78. Procedure mycommand;
  79. begin
  80.   { Place your code here.  This code will get executed when the user hits "J"
  81.     from the main menu. }
  82.  
  83. end;
  84.  
  85. {/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
  86.  
  87. {initialization}
  88.  
  89. {/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\}
  90.  
  91.  
  92. begin
  93.   { You can put initialization code here.  This code will be run BEFORE
  94.     Forum-PC even starts waiting for calls! }
  95. end.
  96.