home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / tpdoors.zip / PCBDOORS.DOC < prev    next >
Text File  |  1988-01-26  |  8KB  |  190 lines

  1.  
  2.  
  3.  
  4.                               PCBDOORS
  5.                 Copyright (C)1988 Joseph E. Goodin III
  6.  
  7.  
  8. This collection of routines will aid any programmer in developing doors
  9. using Turbo Pascal 4.0 that will run under PCBOARD V12.0 or higher.
  10.  
  11. These routines are being distributed in compiled form and released as
  12. shareware.  Door developers are asked to send $10, for each door they
  13. are used in, to:
  14.  
  15.                        Joseph E. Goodin III
  16.                        Circle Drive
  17.                        Tilton, NH  03276
  18.  
  19. Techincal questions may be send to that address or left on the M.O.R.E.
  20. BBS (1-401-849-1874  8/1/N 9600/4800/2400/1200/300).  A copy of the
  21. source code and more liberal usage rights may be purchased from either
  22. of the above sources for $50.  This source code may also be purchased
  23. in Turbo Pascal 3.0 compatible form and a Turbo C version will be
  24. released in the near future.
  25.  
  26.  
  27.  
  28. Interfacing these routines to your door is done by using the following
  29. globally declared variables, functions, and procedures:
  30.  
  31.  
  32. Variables:
  33.  
  34. cfg_location : string128;  -  this variable holds the name and location
  35.     of the door configuration file (Example:  C:DOOR1.CFG).  This variable
  36.     is usually set in the code to just the name of the file with no path
  37.     because in most circumstances the batch file will have already changed
  38.     to the directory where the configuration file and the door program
  39.     are located.
  40.  
  41. sys_location : string128;  -  this variable holds the name and location
  42.     of the pcboard.sys file (Example:  C:\PCB\PCBOARD.SYS).  This variable
  43.     is usually set by calling the get_cfg procedure which gets it by
  44.     reading the first line of the configuration file.
  45.  
  46. machine : string1;  -  this variable holds the type of machine that the
  47.     program will be running on, choices are (I)BM or (C)lone.  This should
  48.     be first set to "I" and then test run.  If there is no echo to the
  49.     sysop screen while being run remotely then the setting should be
  50.     changed to "C".  This causes output to be changed from ROM-BIOS calls
  51.     to MSDOS calls, which are slower but deliver a higher degree of
  52.     compatibility.  This variable is usually set by calling the get_cfg
  53.     procedure which gets it by reading the second line of the configuration
  54.     file.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63. time_on  : integer;  -  this variable holds the number of minutes that the
  64.     user is allowed to access the door.  This variable is usually set by
  65.     calling the get_cfg procedure which gets it by reading the third line
  66.     if the configuration file (Example: 30 = 30 minutes of usage).
  67.  
  68. time_in  : integer;  -  this variable holds the time of day in minutes as
  69.     read from the system clock (Example:  10:45am = 645).  This variable
  70.     is usually set by calling the get_cfg procedure which gets it by
  71.     reading the system clock.
  72.  
  73. time_out : integer;  -  this variable holds the time of day in minutes that
  74.     the user will automatically be ejected from the door because his time
  75.     has expired.  This varialbe is usually set by calling the get_cfg
  76.     procedure which gets it by calculating it using the time_on and time_in
  77.     variables (Example: time_on = 30, time_in = 645, time_out = 675, which
  78.     means the users time will expire at 11:15am).
  79.  
  80. com : integer;  -  this variable holds the device number used by IOCTRL to
  81.     access the COM ports (Examples: COM1 = 0 and COM2 = 1).  This variable is
  82.     usually set by calling the get_cfg procedure which gets it by reading
  83.     the fourth line of the configuration file.  (The configuration file
  84.     entry must be the true DOS number for the COM port, i.e. COM1 = 1).
  85.  
  86. user : string80;  -  this variable holds 80 characters of data that can
  87.     be used by the door developer in any way.  This variable is usually
  88.     set by calling the get_cfg procedure which gets it by reading the fifth
  89.     line of the configuration file.
  90.  
  91. name : string25;  -  this variable holds the full name of the current user
  92.     logged onto the PCBOARD system (Example: JOE GOODIN).  This variable
  93.     is usually set by calling the get_sys procedure which gets it by reading
  94.     the PCBOARD.SYS file.
  95.  
  96. first : string15;  -  this variable holds the first name of the current user
  97.     logged onto the PCBOARD system (Example: Joe).  This variable is usually
  98.     set by calling the get_sys procedure which gets it by reading the
  99.     PCBOARD.SYS file.
  100.  
  101. bps : string4;  -  this variable holds the modem speed of the PCBOARD user
  102.     (Examples: 2400,1200, 300,Loca).  This variable is usually set by calling
  103.     the get_sys procedure which gets it by reading the PCBOARD.SYS file.
  104.  
  105. str_range : set of char;  -  this variable holds a set of characters that
  106.     are considered valid inputs to the getstr function (Example: if the input
  107.     is to be an answer to a Yes/No question then:
  108.                          str_range:= ['Y','y','N','n'];
  109.     would be a good setting for str_range.  At the beginning of the door
  110.     code setting the variable to:
  111.                          str_range:= [' '..'~'];
  112.     would be a good idea).
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. Procedures:
  124.  
  125. procedure get_cfg(cfg_location : string128;
  126.                   var sys_location : string128;
  127.                   var machine : string1;
  128.                   var time_on,time_in,time_out,com : integer;
  129.                   var user : string80);
  130.      This procedure is passed the name and location of the configuration
  131.      file in the variable cfg_location and the other variables are set
  132.      and passed back.  If a configuration file is not found an error is
  133.      trapped, the door is terminated, and control is returned to PCBOARD.
  134.  
  135. procedure get_sys(sys_location : string128;
  136.                   var name : string25;
  137.                   var first : string15;
  138.                   var bps : string4);
  139.      This procedure is passed the name and location of the PCBOARD.SYS
  140.      file in the variable sys_location and the other variables are set
  141.      and passed back.  If PCBOARD.SYS is not found an error is trapped,
  142.      the door is terminated, and control is returned to PCBOARD.
  143.  
  144. procedure wrt(line : string80);
  145.      This procedure outputs the line of text passed to it to the I/O
  146.      port and to the console.  No CR or LF is output.
  147.  
  148. procedure wrtln(line : string80);
  149.      This procedure outputs the line of text passed to it to the I/O
  150.      port and to the console.  A CR and a LF are both output.
  151.  
  152. procedure io_flush;
  153.      This procedure flushes both the keyboard buffer and the I/O port.
  154.  
  155. procedure sysop_window;
  156.      This procedure establishes the sysop window, clears it, and puts
  157.      the sysop hot keys in inverse video at the bottom of the screen.
  158.  
  159.  
  160. Functions:
  161.  
  162. function  ck_time(time_out : integer) : boolean;
  163.      This function returns a boolean that is true if the time passed
  164.      in time_out is less than the current system time and false if it
  165.      is greater than or equal to the current system time.
  166.  
  167. function  get_input : char;
  168.      This function is a single character input from either the keyboard
  169.      or I/O port without waiting for a <CR>.
  170.  
  171. function  getnum(var number : integer) : boolean;
  172.      This function returns an integer number in the range -32768..32767
  173.      in the variable number that is passed to it in the argument.  The
  174.      function itself is a boolean that is true if a valid number has been
  175.      returned and false if number is invalid.
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183. function  getstr(str_length : integer;
  184.                  var strg : string80) : boolean;
  185.      This function returns an string of length str_length the variable
  186.      strg that is passed to it in the argument.  The function itself is
  187.      a boolean that is true if a valid string has been returned and false
  188.      if strg is invalid.
  189.  
  190.