home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / bvdoor10.zip / BVDOOR.TXT < prev    next >
Text File  |  1996-12-23  |  106KB  |  3,019 lines

  1.  
  2.                            BVDoor v1.0 Wide Beta
  3.                 Copyright (C) BV Compuworks Group 1995-1996
  4.                         Release Date: Dec 19, 1996
  5.  
  6. Wide BETA License Agreement
  7.  
  8. THIS IS A LEGAL AGREEMENT TO WHICH YOU ARE CONSENTING TO BE BOUND
  9. BY.  IF YOU CANNOT AGREE TO ALL TERMS OF THIS AGREEMENT, ERASE
  10. ALL SOURCES OF DATA PERTAINING TO THIS SOFTWARE.  BY NOT ERASING
  11. THE DATA, AND CONTINUING TO USE THE SOFTWARE BEYOND THE
  12. EVALUATION PERIOD, YOU AGREE TO ALL TERMS SET WITHIN. 
  13.  
  14. 1.   B.V. Compuworks Group ("BVCom") grants to you a
  15. non-exclusive, non-sublicensable, license to use version 1.0 wide
  16. beta of the B.V.Door (the "Software"), for evaluation and trial
  17. purposes only of no greater than 30 days.
  18.  
  19. 2.   Any and all contents, accessed through the Software, are the
  20. properties belonging to the applicable content owner; and may be
  21. protected by applicable copyright laws.  This License
  22. gives/grants you no rights to such content.
  23.  
  24. 3.   All titles, ownership rights and intellectual property
  25. rights, to the Software, shall remain in BVCom and/or its
  26. suppliers and distributers. By consenting to this licensing
  27. agreement, you acknowledge that the Software, in source code
  28. form, remains a confidential trade secret of BVCom and/or its
  29. suppliers and distributers.  You also agree not to modify the
  30. Software or attempt to alter, change, decipher, decompile,     
  31. disassemble, hack or reverse engineer the Software, except to the
  32. extent applicable laws specifically prohibit such a restriction. 
  33.  
  34. 4.   BVCom may terminate this license, at any time, by delivering
  35. notice to you and you may likewise terminate this license, at any
  36. time, by simply destroying and/or erasing all copies of the
  37. Software and corresponding documentation.
  38.  
  39. 5.   BVCOM MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE
  40. SOFTWARE, ALL ACCOMPANYING MATERIALS, AND ANY CONTENT OR
  41. INFORMATION MADE ACCESSIBLE BY THE SOFTWARE, FOR ANY PURPOSE. 
  42. THE SOFTWARE IS PROVIDED "AS IS" AND UNDER NO CIRCUMSTANCES,
  43. LEGAL THEORY, TORT, CONTRACT OR OTHERWISE, SHALL BVCOM AND/OR
  44. SUPPLIERS AND DISTRIBUTERS BE ACCOUNTABLE AND/OR LIABLE TO YOU OR
  45. ANY OTHER PERSON FOR AN DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR
  46. CONSEQUENTIAL DAMAGES OF ANY KIND.  THE SOFTWARE COMES WITHOUT
  47. EXPRESS OR IMPLIED WARRANTIES, INCLUDING WARRANTIES OF
  48. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR
  49. NONINFRINGEMENT. 
  50.  
  51. 6.   For further assistance pertaining to the Software and/or
  52. documentation please send all inquiries to the Program Manager
  53. or the programmer:
  54.  
  55.         Greg Varga, Co-Owner/Program Manager
  56.         B.V. Compuworks
  57.         18130 60th Street
  58.         Cloverdale, B.C. (Canada)
  59.         V3S 1V6
  60.         (604) 576-2219
  61.         E-Mail Address: xomorph@skybus.com
  62.         Fidonet Address: Greg Varga or Allan Rafuse @
  63.                     Conceptual Realities BBS (1:153/9118) 
  64.  
  65.  
  66. Registration Information
  67.  
  68. Currently there are two registration packages that are available
  69. for BVDoor v1.0.  The first package is the basic package which is
  70. the required by everyone which is $30.00 Canadian; it will be
  71. raised fairly soon to $50.00 in upcoming versions.  The second
  72. package is a for commercial programs.  This package is needed if
  73. you are going to release your programs under a business name or
  74. as a commercial program; excluding Shareware, Freeware,
  75. Crippleware programs.  The fee for commercial registration is
  76. $50.00 Canadian for EACH program that is to be released.  This
  77. will be raised soon to $80.00 in upcoming versions.  See
  78. REGISTER.DOC for the registration form.  The basic package is
  79. good for 2 major releases of BVDoor and is good for all minor
  80. versions which will basically be bug fixes, optimization, ect.  A
  81. major upgrade is comprised of addition of many new functions, a
  82. bunch of minor upgrades, or adding addition BBS packages support,
  83. ect. Upgrading the basic package to a new major version costs
  84. $15.00 no matter what the last version is.
  85.  
  86. TABLE OF CONTENTS
  87.  
  88.  
  89.  
  90.  
  91.               1.... About BVDoor
  92.               1.... Authors Notes
  93.               1.... Getting Help/New Versions     
  94.               2.... Chapter I - Getting Started
  95.               2......... Part I   - The USES Statement
  96.               2......... Part II  - Trapping Exit Codes
  97.               4......... Part III - Trapping Special Keys
  98.               6......... Part IV  - Getting User Information
  99.               7......... Part V   - The Status Bar
  100.               8.... Chapter II - Global Variables
  101.              22.... Chapter III - Procedures and Functions
  102.              47.... BVDoors' CONST Section
  103.              47.... BVDoors' TYPE Section
  104.  
  105. About BVDoor
  106.  
  107. BVDoor is a pascal unit for OS/2 that allows programmers to
  108. easily create their own door programs.  BVDoor makes it easy
  109. because the programmer does not have to worry about the comport
  110. or user information; BVDoor does it all for you.  If you need to
  111. change some of the users information, you can do that too. 
  112. BVDoor was created to encourage programmers to create OS/2
  113. executable online door programs.  To make it easy for an already
  114. made program to be ported to OS/2, BVDoor was cloned to a well
  115. used door unit; JPDoor.  BVDoor follows JPDoor as closely as
  116. possible.  Currently BVDoor has been only with RA 2.xx, Ezycom
  117. 1.20 and AdeptXBBS v1.07f.  QBBS 2.75+ structures are included,
  118. but are only still only in theory because I can't find a copy. 
  119. Maximus, SuperBBS and PCBoard support will be coming in the near
  120. future.  Along with Maximus will come Squish message base
  121. support.
  122.  
  123. Authors Notes:
  124.  
  125. Hope this makes programming a lot easier!  If you encounter any
  126. errors then send us a message telling us EXACTLY what happened. 
  127. Please send a copy of your finished program to xomorph@skybus.com
  128. so what people are doing with BVDoor.  
  129.  
  130. Getting Help/New Versions
  131.  
  132. You can get help from the authors of BVDoor at the following
  133. places: 
  134.  
  135. Snail Mail:
  136.      Greg Varga, Co-Owner/Program Manager
  137.      B.V. Compuworks Group
  138.      18130 60th Street
  139.      Cloverdale, B.C. (Canada)
  140.      V3S 1V6
  141.      (604) 576-2219
  142.         
  143. E-Mail Address: xomorph@skybus.com
  144. Fidonet Address: Greg Varga at 1:153/9118 or
  145.                  Allan Rafuse at 1:153/9118
  146.  
  147.  
  148. New versions can be downloaded from the following places:
  149.  FREQ:   "BVDOOR" from 1:153/9118 (Conceptual Realities)
  150.  FTP SITES: hobbes.nmsu.edu
  151.             ftp.cdrom.com
  152.             oak.oakland.edu
  153.  Web Sites: Virtual Pascal Homepage at:
  154.                http://www.fprint.co.uk/vpascal
  155.  
  156. Chapter I - Getting Started
  157.  
  158. This chapter will help you get started and familiarized with
  159. BVDoor if you are new to programming, BVDoor, or JPDoor.  First
  160. off, open up a new file to start your program in.  The first
  161. thing you'll learn how to do get your program off and running. 
  162. Just follow the examples and include whatever you like.  Your
  163. program should look like the following:
  164.  
  165. PROGRAM progname;
  166.  
  167. BEGIN
  168. END.
  169.  
  170.  
  171.      Part I - The USES statement
  172.  
  173. This follows the commands of JPDoor very closly, but in BVDoor,
  174. all you need in the uses statement is USES DOS, CRT, bvdoor2; 
  175. All the variables and calls are located in this unit so you don't
  176. have to worry about anything.
  177.  
  178.  
  179.      Part II - Trapping Exit Codes
  180.  
  181. BVDoor also allows you to trap halt codes and runtime errors if
  182. you use the far call procedure TRAPEXIT.PAS.  This procedure
  183. checks how the program is exiting.  If a runtime error occurred,
  184. then it is reported into a logfile in the directory where your
  185. program resides with the name 'bvlogname' + node number + '.ERR'. 
  186. If you left the variables at their defaults a logfile of this
  187. name would be BVDOR001.ERR.  If a halt code was used, then this
  188. procedure will call a procedure called TERMINATE passing the
  189. haltcode to it.  Here is an example of a terminate procedure.
  190. You can include this following segment into your program to make
  191. it easier for you.
  192.  
  193. PROCEDURE terminate(haltcode : BYTE);
  194.   BEGIN
  195.     WRITELN('- ', productname, ' Terminating - ');
  196.     WRITE('Exit Type: ');
  197.     CASE haltcode OF
  198.         0 : WRITELN('Normal');
  199.         1 : 
  200.             BEGIN
  201.               WRITELN('Carrier Lost'); 
  202.              {Do what you want in here}
  203.             END;
  204.  
  205.  
  206.  
  207.         2 : 
  208.             BEGIN
  209.               WRITELN('Timelimit Exceeded');
  210.              {Do what you want in here}
  211.             END;
  212.  
  213.         3 :    
  214.             BEGIN
  215.               WRITELN('Inactivity Timeout');
  216.              {Do what you want in here}
  217.             END;
  218.         4 :
  219.             BEGIN
  220.               IF doorsys THEN
  221.                 WRITELN('Can not find ', ckpath(exitinfopath),    
  222.                         'Door.Sys')
  223.               ELSE IF sessioninfo THEN
  224.                 WRITELN('Can not find ', ckpath(exitinfopath),
  225.                         'Session.Info')
  226.               ELSE
  227.                 WRITELN('Can not find ', ckpath(exitinfopath),    
  228.                          'Dorinfo', getnode, '.Def');
  229.             END;
  230.         5 :
  231.             BEGIN
  232.               WRITELN('Can not find ', ckpath(exitinfopath), 
  233.                           'Exitinfo.BBS');
  234.             END;
  235.         6 : BEGIN
  236.               WRITELN('Change Directory Error');
  237.               {Should close all files}
  238.             END;
  239.         8 : BEGIN
  240.               WRITELN('RAXIT Semaphore File Found');
  241.             END;
  242.       END;
  243.   END;
  244.  
  245. Once you have the above copied into your program add the
  246. following right after it: {$I trapexit}
  247. Now in the main body of the program add the following line:
  248. doorexit := trapexit;
  249. Once you have done those three things, your program will be able
  250. to trap exit codes.  Your program should look like this:
  251.  
  252. PROGRAM progname;
  253.  
  254. USES DOS, CRT, bvdoor2;
  255.  
  256. PROCEDURE terminate(haltcode : BYTE);
  257.   BEGIN
  258.     ...
  259.     ...
  260.   END;
  261.  
  262. {$I trapexit}
  263.  
  264. (* Main Program *)
  265. BEGIN
  266.   doorexit := trapexit;
  267.   getdorinfo('1', 'C:\BBS');
  268. END.
  269.  
  270. Now if the program was ran, it would look for the Dorinfo1.Def
  271. file in 'C:\BBS'.  If it couldn't find the Dorinfo1.Def file then
  272. a haltcode of 4 would be called.  If it couldn't find the
  273. Exitinfo.BBS file, then a haltcode of 5 would be called.  If
  274. everything went ok, then the program would terminate normally
  275. with a haltcode of 0.
  276.  
  277.  
  278.      Part III - Trapping 'Special' Keys
  279.  
  280. BVDoor allows you to define up to 20 key sequences for both the
  281. sysop keyboard and the remote keyboard.  This allows you to call
  282. a procedure if a certain key is pressed.  For example, if ALT-C
  283. was pressed on the sysop keyboard, a chat procedure could be
  284. called.  Another example is, the user could press ALT-T to
  285. display how much time they have left.  Lets trap call a chatting
  286. procedure when ALT-C is pressed on the sysop keyboard.  To trap
  287. the ALT-C key stroke, add the following into your main program:
  288.  
  289.   sysopkey[1] := #0 + #46;
  290.   sysopproc[1] := chatproc;
  291.   sysopkeys := TRUE;
  292.   
  293. Now create a procedure called chatproc.
  294.  
  295. PROCEDURE chatproc;
  296.   BEGIN
  297.     sysopkeyson := FALSE;   { Turn of key trapping for now }
  298.     chatting;               { Call your chat procedure     }
  299.     sysopkeyson := TRUE;    { Turn key trapping back on    }
  300.   END;
  301.  
  302. When the sysop presses ALT-C the chatproc will be called.  The
  303. sysopkey trapping is turned off so you can't keep calling the
  304. chatproc from within the chatproc.  Don't forget to turn it back
  305. on if you want to continue trapping keys after the chatting
  306. procedure is done.  ALT-C is known as an extended key because it
  307. sends a null character (ASCII #0), then a second extended key. 
  308. Included is a program called KEYFIND.EXE which tells you the
  309. extended codes of keys you typed.
  310.  
  311. Lets trap CTRL-T on the users keyboard for some more practice. 
  312. Add the following into your main program:
  313.   userkey[1] := #47;
  314.   userproc[1] := timeleft;
  315.   userkeyson := TRUE;
  316.  
  317. Now create a 'timeleft' procedure.
  318.  
  319.  
  320.  
  321. PROCEDURE timeleft;
  322.   BEGIN
  323.     userkeyson := FALSE;
  324.     crlf;
  325.     display(0, 7, 0, 'Time left: ' + itoa(timeremaining));
  326.     userkeyson := TRUE;
  327.   END;
  328.  
  329.  
  330. Below is what you should have so far:
  331.  
  332. PROGRAM progname;
  333.  
  334. USES DOS, CRT, bvdoor2;
  335.  
  336. PROCEDURE terminate(haltcode : BYTE);
  337.   BEGIN
  338.     ...
  339.     ...
  340.   END;
  341.  
  342. PROCEDURE chatproc;
  343.   BEGIN
  344.     ...
  345.     ...
  346.   END;
  347.  
  348. PROCEDURE timeleft;
  349.   BEGIN
  350.     ...
  351.     ...
  352.   END;
  353.  
  354. {$I trapexit}
  355.  
  356. (* Main Program *)
  357. BEGIN
  358.   doorexit := trapexit;
  359.   sysopkey[1] := #0 + #46;
  360.   sysopproc[1] := chatproc;
  361.   sysopkeys := TRUE;
  362.   userkey[1] := #47;
  363.   userproc[1] := timeleft;
  364.   userkeyson := TRUE;  getdorinfo('1', 'C:\BBS');
  365. END.
  366.  
  367.      Part IV - Getting the Users Information
  368.  
  369.  
  370. Now to get the users information, you'll have to know the current
  371. node number and path to the BBS dropfile.  This can be
  372. accomplished in many ways.  The most common way is through passed
  373. parameters.  Just assume for now that the program is on node 1
  374. and in the path to the BBS drop files is 'C:\BBS'.  Now in the
  375. program put the following line:
  376.  
  377. getdorinfo('1', 'C:\BBS');
  378.  
  379. Now if the user loads the program from node 1 and the
  380. Dorinfo1.Def file and the Exitinfo.BBS file are in the 'C:\BBS'
  381. path, then the user information will be loaded in.  If your door
  382. doesn't need to load in the ExitInfo.BBS file, then set the
  383. ckexitinfo variable to false:
  384.   ckexitinfo := FALSE.
  385. This will tell BVDoor that you don't want to read in the
  386. Exitinfo.BBS file.  If BVDoor is reading in a Dorinfox.Def
  387. dropfile and it can't find the ExitInfo.BBS file and the
  388. 'ckexitinfo' variable is TRUE, then a haltcode of 5 will be
  389. called.  Set the 'ckexitinfo' variable to false if your reading
  390. in a Dorinfox.Def file and you don't need it any information from
  391. it.  
  392.  
  393. By default, 'getdorinfo' always reads a Dorinfo1.Def file no
  394. matter what the node number is.  If you want 'getdorinfo' to read
  395. a Dorinfo2.Def file or Dorinfo3.Def and so on, set the following
  396. variable to false:
  397.   forcenode := FALSE;
  398. This tells BVDoor to readin a Dorinfox.Def file instead of always
  399. wanting to readin the Dorinfo1.Def file.
  400. To tell 'getdorinfo' to read a Door.Sys dropfile, set the
  401. 'doorsys' variable to true before calling getdorinfo:
  402.   doorsys := TRUE;
  403. To tell 'getdorinfo' to read a Session.Info dropfile set the
  404. 'sessioninfo' variable to true before calling getdorinfo:
  405.   sessioninfo := TRUE;
  406.  
  407. BVDoor works with an RA 2.xx ExitInfo.BBS structure.  Therefore
  408. all other structures are translated into the RA 2.xx structure
  409. for your use and then converted back to their original structure. 
  410. This is only done if the ExitInfo.BBS file is read in.
  411. The main program of your program should look similar to:
  412.  
  413. (* Main Program *)
  414. BEGIN
  415.   doorexit := trapexit;
  416.   sysopkey[1] := #0 + #46;
  417.   sysopproc[1] := chatproc;
  418.   sysopkeys := TRUE;
  419.   userkey[1] := #47;
  420.   userproc[1] := timeleft;
  421.   userkeyson := TRUE;  
  422.   ckexitinfo := FALSE;    { Uncomment if you don't want to read                 
  423.                               the ExitInfo.BBS File }
  424.   doorsys := TRUE;        { Uncomment if you want to read a                               
  425. Door.Sys dropfile. }
  426.   sessioninfo := TRUE;    { Uncomment if you want to read a                               
  427. Session.Info dropfile. }
  428.   getdorinfo('1', 'C:\BBS');
  429. END.
  430.  
  431.  
  432.      Part V - The Status Bar
  433.  
  434. By default BVDoors 2-line status bar is off.  If you would like
  435. the 2 line status bar on the sysop screen on, set the
  436. 'statusline' variable to true;
  437.   statusline := TRUE;
  438. If the statusline is on, then it contains some of the users
  439. information like, their name, timeleft, current time, node number
  440. and other things.  BVDoor has 9 different bars containing
  441. different lines of information.  To toggle the bars, press the
  442. function keys F1-F9.  F10 will turn the statusline off.  To turn
  443. this it back on, just hit any of the 9 function keys.  You can
  444. also customize the status bars by putting your information into
  445. the following variables where [x] is the function key number:
  446.   statuslinea[x]
  447.   statuslineb[x]
  448. 'statuslinea' is the top line, 'statuslineb' is the bottom line
  449. and both are STRING[79].
  450.  
  451. The following codes are converted on the statusline:
  452.  
  453.      Code      Value               
  454.      ~A   [ANSI] [ASCII] or [MONO]
  455.      ~B   Baud Rate
  456.      ~C   Current Time
  457.      ~R   Time Remaining
  458.      ~S   Security Level
  459.      ~W   Snoop Mode: ON or OFF
  460.  
  461. Unlike JPDoor, BVDoor doesn't have a maximum amount of characters
  462. for each code.  BVDoor was made so you can format the text how
  463. ever you want.
  464.  
  465. Here are the defaults for BVDoors' statlinex[1]:
  466.  
  467.     statlinea[1] := ' ' + ljust(username + ' of ' + user.city + '
  468.                at ' + baudstring + ' BPS', 68) + 'Line [' +                
  469. itoa(atoi(node)) + ']';
  470.     statlineb[1] := ' ' + ljust('Security: ~S', 15) +            
  471. ljust('Time: ~R Mins', 25) + ljust('~A', 7) +               
  472. rjust(productname, 20);
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.                                 BVDoor v1.0
  482.                        Chapter II - Global Variables
  483.  
  484. BVDoor Unit Variables
  485. ──────────────────────
  486.  
  487.      BVDoor has some global unit variables which you can use in
  488. your program.  Most of these are variables are initialized upon
  489. program startup but are actually filled in with the user
  490. information when 'GETDORINFO' is called.
  491.  
  492. activecount    BYTE           Keeps track of keyboard activity.  
  493.                               This is decremented every minute.
  494.                               Once'activecount' reaches 0 a beep 
  495.                               sounds on the users terminal. 
  496.                               Once 'activecount' reaches 0, the
  497.                               program terminates with a halt code 
  498.                               of 3.
  499.  
  500. adept175       BOOLEAN        True if an AdeptXBBS Session.Info
  501.                               drop file was read in.
  502.  
  503. aflag,
  504. bflag,
  505. cflag,
  506. dflag          STRING[8]      Holds the users flag setting.  The
  507.                               flags are read from the             
  508.                               ExitInfo.BBS file.  If it's not 
  509.                               read, then they will hold 8 spaces.
  510.                               If the Exitinfo file was read then
  511.                               it will be in the format of:
  512.                               'XX-XX--X'
  513.  
  514. ansi           BYTE           Is set to 1 if the user has ansi
  515.                               turned on.  If the user's ansi is
  516.                               turned off, then it is set to 0.
  517.                               This can also hold 5 if the user 
  518.                               has Mono-Graphics.
  519.  
  520. baudstring     STRING[35]     This is the users baud rate and
  521.                               comport settings.  Some packages
  522.                               add a '-R' after the baud rate 
  523.                               indicating an Error-Correcting
  524.                               Connection.
  525.  
  526. buffers        BOOLEAN        Initially set to FALSE; this 
  527.                               variable determines whether or not
  528.                               output buffering will be used. 
  529.                               BVDoor does not use this.  It is 
  530.                               only here for JPDoor compatibility.
  531.  
  532. bvlogname      STRING[5]      These are used to name the file         
  533. bvlogext       STRING[3]      of the error.log.
  534.  
  535. bvidlehook     PROCEDURE      This is a kind of a special
  536.                               procedure.  It is called every time
  537.                               BVDoor is in idle.  It give up 
  538.                               timeslices for multitasking
  539.                               systems.  If you don't want your
  540.                               door to give up timeslices then
  541.                               set bvidlehook := NIL;  You could
  542.                               also call your own timeslicing
  543.                               routines if you wish by assigning
  544.                               bvidlehook := your_procedure.  For
  545.                               more information on this, see the
  546.                               'everyminutehook' variable.
  547.  
  548. bv_debug       BOOLEAN        Initially set to FALSE.  If this is
  549.                               set to TRUE, then BVDoor writes 
  550.                               its' activity to a file called in 
  551.                               the same directory as your door 
  552.                               program with the name of
  553.                               DEBUGnnn.Log, where nnn is the node
  554.                               number.  You can allow your users
  555.                               to turn this on by setting the 
  556.                               environment variable in the batch
  557.                               file by: SET BV_DEBUG=ON.  You
  558.                               could also add a command line
  559.                               parameter such as /D or /DEBUG that
  560.                               also turns this on.
  561.  
  562. checkactivity  BOOLEAN        If this is TRUE, then keyboard 
  563.                               activity will be monitored.  You
  564.                               might set this to FALSE if your 
  565.                               program spends time doing something
  566.                               else and isn't calling BVDoor
  567.                               routines.  Then your user won't be
  568.                               thrown off for keyboard inactivity.
  569.  
  570. ckexitinfo     BOOLEAN        If set to FALSE, then BVDoor won't
  571.                               look for a ExitInfo.BBS file.  This
  572.                               is for someone who does not require
  573.                               it in their program or for
  574.                               compatibility for other BBS's.
  575.  
  576. ckmsgs         BOOLEAN        When set to TRUE, BVDoor will check
  577.                               for online messages every minute.
  578.                               If a message is found, then the 
  579.                               variable 'msgwaiting' is set to 
  580.                               TRUE.
  581.  
  582. clubchar       CHAR           Holds the character that BVDoor
  583.                               draws in the DRAWCARD procedure.
  584.                               It defaults to ASCII #5 which is
  585.                               the club character.
  586.  
  587. counter        INTEGER        Used for anything you want.  Enjoy.
  588.  
  589. c_back         BYTE           This holds the current background 
  590.                               color.  Color codes are defined in
  591.                               the DISPLAY procedure.
  592.  
  593. c_blink        BYTE           This variable contains the selected
  594.                               state of the blinking attribute. 
  595.                               A 0 means no blinking and anything
  596.                               else means blinking is in effect.
  597.  
  598. c_fore         BYTE           This holds the current foreground
  599.                               attribute.  Color codes are defined
  600.                               in the DISPLAY procedure.
  601.  
  602. date           STRING[20]     This holds the date of when your 
  603.                               program was loaded.
  604.  
  605. doorexit       PROCEDURE      This is a null procedure when 
  606.                               BVDoor is initialized.  This 
  607.                               procedure is called when your 
  608.                               program exits.  If you want to trap
  609.                               halt codes or do anything else
  610.                               EVERY time the program exists, then
  611.                               assign doorexit to your exit
  612.                               procedure.  See Trapping Halt
  613. Codes.
  614.  
  615. doorsys        BOOLEAN        This tells GETDORINFO to read in a
  616.                               Door.Sys file rather than the 
  617.                               standard DORINFOx.DEF file if it's
  618.                               set to TRUE.  This must be set to 
  619.                               TRUE before a call to GETDORINFO. 
  620.                               The following variables are filled
  621.                               in with Door.Sys:
  622.                                    username
  623.                                    userfirst
  624.                                    userlast
  625.                                    portnum
  626.                                    baudstring
  627.                                    timeremaining
  628.                                    ansi
  629.                               The following are not filled in and
  630.                               are still at their defaults:
  631.                                    systemname := 'BBS';
  632.                                    sysopfirst := 'SYSOP';
  633.                                    sysoplast  := 'NAME';
  634.                                    sysopname  :=  'SYSOP NAME';
  635.                                    usercitystate := 'Unknown';
  636.                                    usersecurity := 0;
  637.                               You can change any of these if you
  638.                               want after you call GETDORINFO.
  639.  
  640. dosver         STRING[30]     This strings contains the DOS/OS2
  641.                               version.  It will be either:
  642.                               'DOS vX.X' or 'OS/2 X.X'.
  643.  
  644. dv             BOOLEAN        Is TRUE if desqview is detected.
  645.                               
  646. dvver          STRING[30]     This is blank unless desqview was
  647.                               detected.  It holds the desqview
  648.                               version and window number.
  649.                               'DESQview X.X [Window X]'
  650.  
  651. everyminutehook
  652.                PROCEDURE      This procedure gets called every
  653.                               minute.  This is a null procedure
  654.                               when the program starts up.  This
  655.                               allows you to assign it a procedure
  656.                               to call to do you own maintenance
  657.                               every one minute.  For example
  658.                               you could make your computer beep
  659.                               everyone minute.  Example; define
  660.                               a procedure:
  661.                               {#F+}  {MUST be a Far Call Proc}
  662.                               PROCEDURE dobeep;
  663.                                    BEGIN
  664.                                         WRITE(#7);
  665.                                    END;
  666.                               Now in your main program type the
  667.                               following:
  668.                               everyminutehook := dobeep;
  669.                               
  670.                               Now every minute when BVDoor does
  671.                               it's own internal maintenance, you
  672.                               can do any cleanup you want.
  673.  
  674. everyfivesecondhook
  675.                PROCEDURE      Same as 'everyminutehook' except 
  676.                               that this is called every 5
  677.                               seconds.
  678.  
  679. exepath        STRING[79]     This holds the full drive and path
  680.                               of where your program is running.
  681.                               This is useful for if your program
  682.                               is not run in it's directory and
  683.                               you need to access some of it's own
  684.                               files.  This allows you to run your
  685.                               door from any directory you want 
  686.                               like a BBS drop path directory and
  687.                               your program can still find it's
  688.                               data files.
  689.  
  690. exitconverted  BOOLEAN        If the ExitInfo.BBS file was 
  691.                               converted to a RA 2.xx format
  692.                               during a call to GETDORINFO, then 
  693.                               this will be TRUE, otherwise it
  694.                               will be FALSE.  DO NOT MODIFY THIS
  695.                               YOURSELF AS IT WILL SCREW UP THE 
  696.                               DROPFILES!!!
  697.  
  698. exitinfo       exitinforecord This holds the ExitInfo.BBS file
  699.                               data.  If the ExitInfo.BBS was 
  700.                               converted to an RA 2.xx format then 
  701.                               some of the fields will be blank.
  702.  
  703. exitinfobbsname STRING        Contains the full path and file
  704.                               name of the ExitInfo.BBS file.
  705.                               It is initialized when GETDORINFO                           
  706.                               is called and if CKEXITINFO is                    
  707.                               TRUE.
  708.  
  709. exitinfopath   STRING         Contains only the path to the                           
  710.                               ExitInfo.BBS File.  It is '' until
  711.                               GETDORINFO is called.  It is set to
  712.                               the directory that is passed to
  713.                               GETDORINFO.  Use this whenever you
  714.                               want to find the dropfiles.
  715.  
  716.  
  717.  
  718. extendedchars  BOOLEAN        Defaults to FALSE.  If you want
  719.                               users to be able to input extended
  720.                               characters in input routines, then
  721.                               set this to true.  When it's FALSE,
  722.                               it helps act as a safeguard against
  723.                               line noise.
  724.  
  725. forcenode      BOOLEAN        Forces GETDORINFO to read only a
  726.                               DORINFO1.Def, no matter what node
  727.                               is passed to it.  It defaults to 
  728.                               TRUE so if you want to read a 
  729.                               DORINFO2.DEF set this to FALSE.
  730.  
  731. fossilhot      BOOLEAN        If this is set to TRUE, then the
  732.                               fossil driver will be de-
  733.                               initialized upon program exiting.
  734.                               BVDoor does not use this.  It is
  735.                               only here for compatibility with
  736.                               JPDoor.
  737.  
  738. fossilinstalled BOOLEAN       Is TRUE if a fossil driver was 
  739.                               detected during a call to
  740.                               'initfossil'.  Returns true in
  741.                               'local' mode.  BVDoor does not use
  742.                               this.  It is only here for 
  743.                               compatibility with JPDoor.
  744.  
  745. fossilrev      INTEGER        Contains the fossil revision                            
  746.                               level.
  747.  
  748. fourdos        STRING[30]     Defaults to ''.  If 4Dos is
  749.                               detected, then this will contain:
  750.                               '4DOS X.X [Shell X]'
  751.  
  752. funckey        BOOLEAN        Returns TRUE if the last key
  753.                               pressed was an extended character
  754.                               in any of the keyboard input
  755.                               commands or if an extended hotkey
  756.                               was pressed.
  757.                               
  758. hdr            msghdrrecord   This variable is of type
  759.                               'msghdrrecord' and is only used by
  760.                               BVDoor in the 'postmsg' function.
  761.  
  762. hmboverride    BOOLEAN        If your door doesn't use the 
  763.                               ExitInfo.BBS fill and you want to
  764.                               use the postmsg function, then
  765.                               you must set this to TRUE.
  766.  
  767. hotkey         CHAR           If you do not tell BVDoor to kill
  768.                               the hotkey after it is pressed,
  769.                               then this is the variable that it
  770.                               will be stored in.
  771.  
  772. hotkeyon       BOOLEAN        Set to FALSE on program startup.
  773.                               This is set during calls to
  774.                               'hotkeys_on' and 'hotkeys_off'.
  775.                               See section on Hotkeys.
  776.  
  777. hotkeypressed  BOOLEAN        Set to FALSE on program startup.
  778.                               If hotkeys is TRUE and a valid
  779.                               hotkey is pressed, then this will
  780.                               be TRUE. See section on Hotkeys.
  781.  
  782. hr,mn,sec,dum  LONGINT        Used internally for the time
  783.                               routines.  
  784.  
  785. ignorecarrier  BOOLEAN        Defaults to FALSE.  If this is                                        
  786.                               TRUE, then any call to 'carrier'
  787.                               will return TRUE.
  788.  
  789. inactiveval    BYTE           This is the amount of time allowed
  790.                               before the program is terminated 
  791.                               due to inactivity.  This defaults
  792.                               to 2.  If you set it to anything
  793.                               else, set it higher than 1 because
  794.                               BVDoor sends a beep and message to
  795.                               the user when 'activecount' gets to
  796.                               1.
  797.  
  798. inusefile      STRING[79]     This variable is used in the
  799.                               'gameinuse' function.  See
  800.                               gameinuse for more information.
  801.  
  802.  
  803. killhotkey     BOOLEAN        Toggled TRUE/FALSE by
  804.                               'sethotkeys_on' procedure by the
  805.                               variable passed to which is either
  806.                               kill or nokill.  If a hotkey is
  807.                               pressed and 'kill' is set, then you
  808.                               can not find out which key was hit.
  809.                               If you wish to know what key was 
  810.                               pressed then call 'sethotkeys_on'
  811.                               with the 'nokill' parameter.  See
  812.                               'sethotkeys_on' for more                               
  813. information.
  814.  
  815. lastactivity   INTEGER        This is the time that the last key
  816.                               was entered.  This is minutes since
  817.                               midnight.
  818.  
  819. local          BOOLEAN        Initially set to FALSE.  It is set
  820.                               to TRUE if the user has logged on
  821.                               locally.  Initialized by the
  822.                               GETDORINFO procedure.
  823.  
  824.  
  825. localkey       BOOLEAN        This is TRUE if the lastkey pressed
  826.                               was from the local keyboard.  You
  827.                               may want to use this somewhere like
  828.                               to write a splitscreen sysop chat
  829.                               program.
  830.  
  831. msgbuff        ARRAY[0..100]
  832.                OF STRING[80]  This is the array which holds the
  833.                               message text for the 'postmsg'
  834.                               function.  msgbuff[0] is reserved
  835.                               for internal use.
  836.  
  837. msgtome        STRING[45]     This holds the fullpath and
  838.                               filename for an online message to
  839.                               the current node.  This is only
  840.                               used with RA/QBBS and
  841.                               if 'multinode' is TRUE.  IE:
  842.                               'C:\RA\SEM\NODE1.RA'.
  843.  
  844. msgwaiting     BOOLEAN        If 'multinode' is TRUE and the
  845.                               current node has a message waiting
  846.                               for them, then this is TRUE,
  847.                               otherwise it returns FALSE.  This
  848.                               is updated every 20 seconds when
  849.                               BVDoor checks for an online 
  850.                               message.
  851.  
  852. multinode      BOOLEAN        Default is FALSE.  If it is left
  853.                               at FALSE, then ALL of the multinode
  854.                               functions are disabled.  They will
  855.                               just exit with nothing happening. 
  856.                               If you don't need to use any of the
  857.                               multinode functions, then turn this
  858.                               off to speed your program up just 
  859.                               that much more.
  860.  
  861. nocomcts       BOOLEAN        Set this to TRUE if you wish to 
  862.                               ignore the CTS signal for any
  863.                               reason.
  864.  
  865. node           STRING[3]      Node defaults to '1'.  This is used
  866.                               to specify which line number is in
  867.                               use.
  868.  
  869. nwver          STRING[30]     Defaults to ''.  If BVDoor detects
  870.                               Novell Network upon program
  871.                               startup, then this will be the 
  872.                               following: 'Novell Netware Shell
  873.                               vX.X'.  If Novell Netware is
  874.                               detected, then file shareing will
  875.                               be used regardless of 'share'.
  876.  
  877. os2            BOOLEAN        If OS/2 is detected on program
  878.                               startup, then this is set to TRUE
  879.                               and the version number is stored in
  880.                               'dosver'.  See 'dosver'.
  881.  
  882. portnum        BYTE           This is the comport in use.  If the
  883.                               user is local, the the portnum will
  884.                               be 0.  If the user is connected to
  885.                               a pipe, then the pipename is stored
  886.                               in the variable 'pipename'.
  887.  
  888. pipename       STRING         Holds the name of the currently
  889.                               connected pipe.
  890.                          
  891. portstat       ARRAY
  892.                [0..maxport]
  893.                OF WORD        Contains the last status word from
  894.                               the last call to the comport/pipe.
  895.  
  896. productname    STRING[20]     Defaults to 'BVDoor Program'.  This
  897.                               can be used to display the name of
  898.                               your program and is display on the
  899.                               statusbar by default.
  900.  
  901. qbbs275        BOOLEAN        If 'ckexitinfo' is TRUE, then this
  902.                               will be TRUE if the ExitInfo.BBS 
  903.                               drop file is in QBBS v2.75 format.
  904.                               BVDoor then uses this to know what
  905.                               structure to use for multinode 
  906.                               functions.  The drop file is then
  907.                               converted to a RA 2.xx format while
  908.                               it is read in and then written back
  909.                               to this format upon exit.
  910.  
  911. qbbs276        BOOLEAN        See the variable 'qbbs275'.
  912.  
  913. qbbs280        BOOLEAN        See the variable 'qbbs275'.
  914.  
  915. ra110          BOOLEAN        If 'ckexitinfo' is TRUE then this
  916.                               will be TRUE if the ExitInfo.BBS
  917.                               drop file is in RA v1.10 format.
  918.                               BVDoor then uses this to know what
  919.                               structures to use for multinode
  920.                               functions.  The drop file is then
  921.                               converted to a RA 2.xx format while
  922.                               it is read in and then written back
  923.                               to this format up exit.
  924.  
  925. ra200          BOOLEAN        IF 'ckexitinfo' is TRUE then this
  926.                               will be TRUE if the ExitInfo.BBS
  927.                               drop file is in RA 2.xx format.
  928.                               BVDoor then uses this to know what
  929.                               structures to use for multinode
  930.                               functions.  No conversion is done.
  931.  
  932. rip            BOOLEAN        IF RA 2.xx ExitInfo.BBS says that
  933.                               the user has rip, then this is set
  934.                               to TRUE.
  935.  
  936. super117       BOOLEAN        See the variable 'qbbs275'.
  937.  
  938.  
  939. range          charset        Used internally to hold which
  940.                               hotkeys can be pressed.  You set
  941.                               this variable like this:
  942.                               range := ['A', 'B', 'C'];
  943.  
  944. raxit          BOOLEAN        If this is TRUE, then BVDoor will
  945.                               check the 'semaphorepath' directory
  946.                               for a 'RAXIT'nodenum'.eee.  The 
  947.                               'nodenum' is the node number and
  948.                               the 'eee' is the error level to
  949.                               exit RA with, NOT THE DOOR!  See
  950.                               the procedure 'chkraxit' for more
  951.                               information.
  952.  
  953.  
  954.  
  955. regs           REGISTERS      This is used when calling
  956.                               interrupts and is simply the 
  957.                               REGISTERS type defined in the DOS
  958.                               unit.  Not implemented by BVDoor.
  959.  
  960. scrap_entry    STRING[35]     Used by the 'getline' function.  
  961.                               This holds the previously wrapped
  962.                               string of text.  See the procedure
  963.                               'getline' for more information.
  964.  
  965. scrlen         BYTE           Defaults to 24.  This is the users
  966.                               screen length and is Initialized
  967.                               when the ExitInfo.BBS file is read.
  968.                               If the ExitInfo.BBS file is not 
  969.                               read in or any other weird numbers
  970.                               are read in, then it will stay at
  971.                               the default of 24.
  972.  
  973. semaforepath   STRING         If RemoteAccess is used then set
  974.                               this to Remote Access's semaphore
  975.                               path so that it can find the
  976.                               online messages.  If it isn't set
  977.                               to RA's semaphore path, then you
  978.                               won't receive any online messages.
  979.  
  980. sessioninfo    BOOLEAN        Defaults to FALSE.  Set this to
  981.                               true if you want to read in a
  982.                               Session.Info dropfile.
  983.  
  984. showwindow     BOOLEAN        Defaults TRUE.  If this is set to
  985.                               FALSE, then the blowup window at
  986.                               the start of program execution will
  987.                               not be shown for the 2 second
  988.                               period.
  989.  
  990. snoop          BOOLEAN        If this is set to FALSE then all
  991.                               output to the local screen is
  992.                               suspended.  Not used if the user is
  993.                               logged on locally.
  994.  
  995.  
  996. sofar          STRING         This is a temporary variable used   
  997.                               by the getline' routines.  If
  998.                               you press a key to chat with the
  999.                               user, then all his text will be out
  1000.                               of wack.  You can this redisplay
  1001.                               this variable and pass it back to
  1002.                               the getline routine that you
  1003.                               called after you are done chatting.
  1004.  
  1005. statlinea      ARRAY[1..9]
  1006.                OF statstr     This is the array that holds the
  1007.                               text for the top line of the status
  1008.                               bar.  Use this if you wish to 
  1009.                               modify any of the status bars.
  1010.  
  1011. statlineb      ARRAY[1..9]
  1012.                OF statstr     This is the array that holds the
  1013.                               text for the bottom line of the
  1014.                               status bar.  Use this if you wish
  1015.                               to modify any of the status bars.
  1016.  
  1017.  
  1018. statusbar      BYTE           This is used to tell which status
  1019.                               bar to display.  Defaults to 1.  If
  1020.                               it was set to 6, then statlinea[6]
  1021.                               and statlineb[6] would be displayed
  1022.                               on the bottom of the screen if the
  1023.                               'statuslineon' variable is TRUE.
  1024.  
  1025. statuslineon   BOOLEAN        Defaults to FALSE.  If this is set
  1026.                               to TRUE, then a two line status bar
  1027.                               is drawn on the bottom of the
  1028.                               screen.
  1029.  
  1030. storedpassword STRING[15]     Since RA stores it's password in a
  1031.                               CRC, the password is not saved
  1032.                               anywhere for you to use.  This is
  1033.                               for compatability with QBBS which
  1034.                               still saves it's password in text
  1035.                               format.  If qbbs275, qbbs276 or
  1036.                               qbbs280 is TRUE, then the users
  1037.                               password is stored here so you can
  1038.                               change it if you want.
  1039.  
  1040. sysopfirst     STRING[35]     This is initialized during the call
  1041.                               to 'getdorinfo' and reading of the
  1042.                               'DorinfoX.Def' file.  If you read
  1043.                               the 'Door.Sys' file then this stays
  1044.                               at it's default: 'Sysop'.
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054. sysopkey       ARRAY
  1055.                [1..maxkeys]
  1056.                OF STRING[2]   This variable holds the local sysop
  1057.                               keys.  If one of these keys is 
  1058.                               pressed during a call to one of the
  1059.                               keyboard functions then it's 
  1060.                               corresponding 'sysopproc' will be
  1061.                               called.  See 'Sysop and Userkeys'.
  1062.  
  1063. sysopkeyson    BOOLEAN        Must be set to TRUE if you want to
  1064.                               be able to trap the sysopkeys.  It
  1065.                               defaults to FALSE.
  1066.  
  1067. sysoplast      STRING[35]     See 'sysopfirst'.  This defaults to
  1068.                               'Name'.
  1069.  
  1070. sysopname      STRING[35]     This is the sysops full name.
  1071.                               sysopfirst + ' ' + sysoplast.  If
  1072.                               these variables are at their
  1073.                               defaults, then 'sysopname' would
  1074.                               be: 'Sysop Name'.
  1075.  
  1076.  
  1077. sysopproc      ARRAY
  1078.                [1..maxkeys]
  1079.                OF PROCEDURE   This variable stores the list of 
  1080.                               sysop far call procedures.  If 
  1081.                               sysopkey[2] was pressed then
  1082.                               sysopproc[2] is called.  See
  1083.                               'Sysop and Userkeys'.
  1084.  
  1085. systemname     STRING[40]     This is the name of the BBS that
  1086.                               is read from the 'DorinfoX.Def' 
  1087.                               file when 'getdorinfo' is called.
  1088.  
  1089. thisnode       STRING[3]      Defaults to '001'.  It is used to
  1090.                               display the default status bar.
  1091.                               It is up to you to change this as
  1092.                               all it is here for is for display
  1093.                               on the statusbar.
  1094.  
  1095. time           STRING[10]     This is the time that your program
  1096.                               was loaded up.
  1097.  
  1098. timeremaining  INTEGER        This is the users time left in
  1099.                               minutes.  If you need to know the
  1100.                               seconds then see the
  1101.                               'get_time_left' procedure.  DO NOT
  1102.                               CHANGE THIS YOURSELF.  If you do,
  1103.                               it will just go back to what it was
  1104.                               before.  If you wish to alter the
  1105.                               users time, see the procedures on
  1106.                               'Time Limit Routines'
  1107.  
  1108.  
  1109.  
  1110. twominutewarning
  1111.                PROCEDURE      This procedure is called when the
  1112.                               use has two minutes left.  Use this
  1113.                               to do whatever you want when this
  1114.                               occurs.  See 'everyminutehook' for
  1115.                               more information on how to use
  1116.                               this.
  1117.  
  1118. txtiobuffer    ARRAY
  1119.                [1..4096] OF
  1120.                CHAR           This is a buffer used for textfile
  1121.                               reading.  You can use this for your
  1122.                               own use if you need to.
  1123.  
  1124. usehandle      BOOLEAN        Defaults to FALSE.  If this is 
  1125.                               TRUE, then handles/aliases will be
  1126.                               shown in the 'useron/useronnode'
  1127.                               procedures.
  1128.  
  1129. uselock        BOOLEAN        If share is detected, then this
  1130.                               will be set to TRUE and file 
  1131.                               locking will be used.  If this is
  1132.                               FALSE then all file locking
  1133.                               routines will just exit.  This is
  1134.                               initialized on startup.
  1135.  
  1136.  
  1137. usercitystate  STRING         Initialized when the 'DorinfoX.Def'
  1138.                               file is readin when 'getdorinfo' is
  1139.                               called.  
  1140.  
  1141. usefirst       STRING[35]     See 'sysopname'.  Defaults to
  1142.                               'User'.
  1143.  
  1144.  
  1145.  
  1146. userhungup     BOOLEAN        Defaults to FALSE.  If TRUE, then
  1147.                               If your door is running on a QBBS
  1148.                               v2.76+ and your using the
  1149.                               ExitInfo.BBS file then the QBBS
  1150.                               field is updated on exit.  You must
  1151.                               set this automatically.
  1152.  
  1153. userkey        ARRAY
  1154.                [1..maxkey]
  1155.                OF STRING[2]   This array stores the keys that the
  1156.                               user can press to activate a
  1157.                               certain procedure.  See 'Sysop and
  1158.                               Userkeys' for more information.
  1159.  
  1160. userlanguage   BYTE           If using RemoteAccess, then this is
  1161.                               the users language number.
  1162.  
  1163. userlast       STRING[35]     See 'sysoplast'.  Defaults to
  1164.                               'Name'.
  1165.  
  1166.  
  1167. username       STRING[35]     See 'sysopname'.  Defaults to
  1168.                               'User Name'.
  1169.  
  1170. userproc       ARRAY
  1171.                [1..maxkey]
  1172.                OF PROCEDURE   This variable stores the list of
  1173.                               far call procedure that corresponds
  1174.                               to userkey.  See 'Sysop and
  1175.                               Userkeys' for more information.
  1176.  
  1177. usersecurity   WORD           This is initialized from the 
  1178.                               'getdorinfo' procedure.
  1179.  
  1180. winver         STRING[30]     If Windows is detected on startup,
  1181.                               then this contains the version and
  1182.                               mode windows is running in.
  1183.                               'Windows 3.xx Std. Mode' or
  1184.                               'Windows 3.xx Enhanced Mode'.
  1185.  
  1186.                                 BVDoor v1.0
  1187.                 Chapter III  - Procedure and Function Calls
  1188.  
  1189. Screen Display Routines
  1190. ────────────────────────
  1191.  
  1192. ─────────────────────────────────────────────────────────────────
  1193. CLEARSCREEN
  1194.  
  1195.   PROCEDURE clearscreen;
  1196.  
  1197. This clears the remote and local screen.  Use this command
  1198. instead of CLRSCR because CLRSCR will not clear the remote screen
  1199. and it will not scroll the local correctly if the statusbar is
  1200. on.
  1201.  
  1202. Example:
  1203.    BEGIN
  1204.      getdorinfo('1', 'C:\Ra');
  1205.      clearscreen;
  1206.    END;
  1207. ────────────────────────────────────────────────────────────────
  1208. CRLF
  1209.  
  1210.   PROCEDURE crlf;
  1211.  
  1212. Writes a carriage return and line feed to the remote and local
  1213. screen. Can be very useful after a call to SDISPLAY.
  1214.  
  1215. Example:
  1216.    BEGIN
  1217.      getdorinfo('1', 'C:\Ra');
  1218.      crlf;
  1219.    END;
  1220. ────────────────────────────────────────────────────────────────
  1221. CLRLN
  1222.  
  1223.   PROCEDURE clrln;
  1224.  
  1225. Clears the current line and moves the cursor to the beginning of
  1226. the line.
  1227.  
  1228. Example:
  1229.    BEGIN
  1230.      getdorinfo('1', 'C:\Ra');   sdisplay(0, 7, 0, 
  1231.      'Once you hit  any key, this line text will disappear!');
  1232.      clrln;
  1233.    END;
  1234. ────────────────────────────────────────────────────────────────
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246. DISPLAY
  1247.  
  1248.   PROCEDURE display(bg, fg, blink : BYTE; s : STRING);
  1249.  
  1250. Writes 's' to the local and remote screens with a cr/lf.
  1251. Equivalent to the WRITELN command.  Again do not use the WRITELN
  1252. command as it will not scroll the local screen correctly and will
  1253. not write 's' to the remote screen.  'bg' is the background color
  1254. 's' will be displayed on.  'fg' is the foreground.  's' will
  1255. blink on the screens if 0 is not passed to it.
  1256. Valid 'bg' colors are:
  1257.      0 : black           4: red
  1258.      1 : blue            5: magenta
  1259.      2 : green           6: brown
  1260.      3 : cyan            7: grey
  1261. Valid 'bg' colors are:
  1262.      0 : black           8 : dark grey
  1263.      1 : blue            9 : light blue
  1264.      2 : green          10 : light green
  1265.      3 : cyan           11 : light cyan 
  1266.      4 : red            12 : light red
  1267.      5 : magenta        13 : light magenta
  1268.      6 : brown          14 : yellow
  1269.      7 : grey           15 : white
  1270.  
  1271. Example:
  1272.   display(1, 10, 0, 'Hello World');
  1273. The above would display 'Hello World' on a blue background in
  1274. light green text.
  1275.  
  1276.   display(0, 14, 1, 'Your ansi mode is: ' + itoa(ansi))
  1277. The above would display 'Your ansi mode is: 1' in flashing
  1278. yellow.
  1279.  
  1280. See Also: SDISPLAY, CHAROUT, ITOA, WTOB, WTOH
  1281. ────────────────────────────────────────────────────────────────
  1282. DISPLAYLOC
  1283.  
  1284.   PROCEDURE displayloc(bg, fg, blink : BYTE; s : STRING);
  1285.  
  1286. Writes 's' to the local screen ONLY without a cr/lf.  Equivalent
  1287. to the WRITE command.  Do not use the WRITE command as it will
  1288. not scroll the local screen correctly.  'bg' is the background
  1289. color 's' will be displayed on.  'fg' is the foreground.  's'
  1290. will blink on the screens if 0 is not passed to it.
  1291.  
  1292. Example:
  1293.   displayloc(1, 10, 0, 'Hello World');
  1294. Would display 'Hello World' on a blue background in green text on
  1295. the sysop's screen only! 
  1296.  
  1297.   displayloc(0, 14, 1, 'Your ansi mode is: ' + itoa(ansi)) 
  1298. Would display 'Your ansi mode is: 1' in flashing yellow on the
  1299. sysop's screen only!
  1300.  
  1301. See Also: DISPLAY, SDISPLAY, CHAROUT, ITOA, WTOB, WTOH
  1302. ────────────────────────────────────────────────────────────────
  1303. DRAWCARD
  1304.  
  1305.   PROCEDURE drawcard(cardnum : STR2; suit : cardsuit; row, col,
  1306.                         cardcolor : BYTE; edge : BOOLEAN);
  1307.  
  1308. Draws ANSI graphic playing cards within your door.  Each card is
  1309. 3 rows high by 5 columns wide.  Black cards are displayed black
  1310. on grey, red cards are displayed red on grey.  'cardcolor'allows
  1311. you to draw different colors of blank cars.  If 'cardcolor' is 0,
  1312. then it will default to 7. This procedure will exit if the
  1313. variable 'ansi' is set to 0. The parameters for drawcard are:
  1314.  
  1315.   'cardnum'   is '1' through '10','J','Q','K','A' OR 'B' for            
  1316.               a blank card.
  1317.   'cardsuit'  is C, D, H or S (for the clubs, diamonds, hearts           
  1318.               spades).
  1319.   'row'       is the row where the card is to be drawn.
  1320.   'col'       is the column where the card is to be drawn.
  1321.   'cardcolor' the background color of the blank cards.
  1322.   'edge'      if true, a border will be drawn around the card.
  1323.  
  1324. Example:
  1325.    BEGIN
  1326.      getdorinfo('1', 'C:\Ra');
  1327.      sdisplay(0, 7, 0, 'Hit a key;the line text will
  1328. disappear!');
  1329.      IF ansi = 0 THEN
  1330.         BEGIN
  1331.            display(0, 10, 0, 'Sorry, but you need ansi graphics'
  1332.                               + 'for this game.');
  1333.            sdisplay(0, 14, 0, '**Pause**');
  1334.            HALT(0);
  1335.         END;
  1336.      clearscreen;
  1337.      drawcard('A', S, 2, 2, 7, TRUE);
  1338.    END;
  1339.  
  1340. This example checks to see if the user has ansi graphics.  If
  1341. not, then the door kicks the user out.  If the user is capable of
  1342. ansi graphics, then an ace of spades is drawn on line 2, col 2
  1343. with a border.
  1344. ────────────────────────────────────────────────────────────────
  1345. GAMESCREEN
  1346.  
  1347.   PROCEDURE gamescreen(filename : STRING);
  1348.  
  1349. GAMESCREEN is a faster method of displaying an ANSI graphic
  1350. screen (such as a full screen game board, etc.) than SHOWFILE.
  1351. SHOWFILE works the same but is a bit slower since it checks for
  1352. sysop/hot keys and a few other routines.  GAMESCREEN does not
  1353. check for ANYTHING. The screen is cleared before the file is
  1354. shown and page pausing is NOT in effect.  If 'filename' does not
  1355. exist then the procedure just exists.  If 'bvdebug' is true and
  1356. 'filename' doesn't exist, then an error message will be written
  1357. to the debug log file.
  1358.  
  1359. See Also: ASC, SHOWFILE
  1360. ────────────────────────────────────────────────────────────────
  1361. SDISPLAY
  1362.  
  1363.   PROCEDURE sdisplay(bg, fg, blink : BYTE; s : STRING);
  1364.  
  1365. Writes 's' to the local and remote screens WITHOUT a cr/lf.
  1366. Equivalent to the WRITE command.  Again do not use the WRITE
  1367. command as it will not scroll the local screen correctly.  'bg'
  1368. is the background color 's' will be displayed on.  'fg' is the
  1369. foreground.  's' will blink on the screens if 0 is not passed to
  1370. it.
  1371.  
  1372. See Also: DISPLAY, CHAROUT, ITOA, WTOB, WTOH
  1373. ────────────────────────────────────────────────────────────────
  1374. SETCOLOR
  1375.  
  1376.   PROCEDURE setcolor(bg, fg, blink : BYTE);
  1377.  
  1378. Sets the current color for outputing text.  This procedure is
  1379. called by internal functions (ie DISPLAY, SDISPLAY), but you may
  1380. need to use it some of the other functions like: CHAROUT,
  1381. BACKSPACE. 'bg' is the background color, 'fg' is the foreground
  1382. color of the text and if blink is not 0, the text will blink. 
  1383.  
  1384. See Also: DISPLAY
  1385. ────────────────────────────────────────────────────────────────
  1386. SETGRAPHICS
  1387.  
  1388.   FUNCTION setgraphics : CHAR;
  1389.  
  1390. This function looks at the users ansi setting 'ansi' and returns:
  1391.    'A' ... if 'ansi' is 0 (Ascii)
  1392.    'C' ... if 'ansi' is 1 (Ansi color)
  1393.    'M' ... if 'ansi' is 5 (Monochrome Graphics)
  1394.  
  1395. Example:
  1396.   BEGIN
  1397.     getdorinfo('1', '');
  1398.     IF setgraphics = 'A' THEN
  1399.       BEGIN
  1400.         display(0, 1, 0, 'Sorry, but you need ansi graphics to'                      + 
  1401.         ' play this game');
  1402.         HALT(0);
  1403.       END;
  1404.   END.
  1405. ────────────────────────────────────────────────────────────────
  1406. SHOWFILE
  1407.  
  1408.   PROCEDURE showfile(initcolor, ptype, pcolor : BYTE;
  1409.                         filename, path : STRING);
  1410.  
  1411. Displays an ansi/ascii/text file to the local and remote screen.
  1412. If the filename has no extension, then 'ansi' variable and use
  1413. either 'ANS', 'ASC'.  If the 'ansi' is 1 or 5 then it will use
  1414. filename.ANS.  If this file doesn't exist it will display
  1415. filename.ASC.  Showfile exits if the file cannot be found and
  1416. will log it using bv_log.
  1417.  
  1418. SHOWFILE parameters:
  1419.   'initcolor' is the initial drawing color if it is not an ansi   
  1420.               file.
  1421.   'ptype'     is the prompt type Either 1, 2, 3, 4.
  1422.   'pcolor'    is the foreground color the prompt will be          
  1423.               displayed in.
  1424.   'filename'  is the file to be displayed.
  1425.   'path'      is the path where 'filename' exists.
  1426.  
  1427. Page pausing with 
  1428.      Type 1 = '==PAUSE=='
  1429.      Type 2 = 'More (Y/n)'
  1430.      Type 3 = 'More (Y/n/=)'
  1431.      Type 4 = 'Hit [Enter] to continue'
  1432.  
  1433. Example:
  1434.   
  1435.      showfile(0, 0, 0, 'Welcome.Ans', 'C:\Ra\TxtFiles');
  1436. The above would display the welcome file in the RA textfile
  1437. directory without any pausing and would start drawing with the
  1438. current foreground color.
  1439.  
  1440.   showfile(0, 2, 14, 'Welcome.Ans', 'C:\Ra\TxtFiles');
  1441. The above would display the welcome file in the RA textfile
  1442. directory with the prompt type 2 (More (Y/n)) at every 'scrlen'
  1443. with the color yellow.
  1444. ────────────────────────────────────────────────────────────────
  1445.  
  1446.  
  1447.  
  1448. Keyboard Input Routines
  1449. ────────────────────────
  1450.  
  1451. ────────────────────────────────────────────────────────────────
  1452. ASK_YN
  1453.  
  1454.   FUNCTION ask_yn(prompt : STRING; fg : BYTE) : CHAR;
  1455.  
  1456. Displays 'prompt' to the screen and adds '(Y/N): ' to the end of
  1457. 'prompt' and waits for a user to press 'Y' or 'N'.
  1458.  
  1459. Example:
  1460.  
  1461.   REPEAT
  1462.     ch := ask_yn('Keep answering this question?', 14);
  1463.   UNTIL (ch = 'N');
  1464. ────────────────────────────────────────────────────────────────
  1465. CHARIN
  1466.  
  1467.   FUNCTION charin : CHAR;
  1468.  
  1469. Returns the next character in the input queue.  If the input
  1470. queue is empty, then a null character will be returned (#0).
  1471.  
  1472. See Also: GETCHAR
  1473. ────────────────────────────────────────────────────────────────
  1474.  
  1475. GETCHAR
  1476.  
  1477.   FUNCTION getchar : CHAR;
  1478.  
  1479. Returns the next character in the input queue.  If the input
  1480. queue is empty, then GETCHAR will wait until a character is read
  1481. in. 
  1482.  
  1483. See Also: CHARIN
  1484. ────────────────────────────────────────────────────────────────
  1485. CHAROUT
  1486.  
  1487.   PROCEDURE charout(ch : CHAR);
  1488.  
  1489. Sends a character to the output buffer.  It does not display it
  1490. to the local screen.
  1491.  
  1492. See Also: CHARIN
  1493. ────────────────────────────────────────────────────────────────
  1494. GETBIRTHDATE
  1495.  
  1496.   FUNCTION getbirhdate : STRING;
  1497.  
  1498. Gets a valid birthday from the remote/local user.  It will be
  1499. returned in the format of 'MM-DD-YY'.
  1500. ────────────────────────────────────────────────────────────────
  1501. GETINTEGER
  1502.  
  1503.   FUNCTION getinteger(VAR int : LONGINT; min, max : LONGINT;
  1504.                          usebefore : BOOLEAN);
  1505.  
  1506. Inputs a number from user and waits for them to press enter.  The
  1507. number inputed will be inputed only between 'min' and 'max'.  If
  1508. 'usebefore' is true, then GETINTEGER will display:
  1509.  
  1510. 'New Info (0-10): 20'
  1511.  
  1512. Example:
  1513.   BEGIN
  1514.     int := 5;
  1515.     display(0, 7, 0, 'Enter a number 1-10: ');
  1516.     getinteger(int, 1, 10, FALSE);
  1517.   END
  1518. The above would only accept a number between 1 and 10.
  1519.  
  1520.   BEGIN
  1521.     int := 5;
  1522.     display(0, 7, 0, 'Enter a number 1-10: ');
  1523.     getinteger(int, 1, 10, TRUE);
  1524.   END
  1525.  
  1526. The above would look like the first example but the screen
  1527. displays would look like this.  5 is the default because that is
  1528. what 'int' was set to.  
  1529.   'Enter a number 1-10:'
  1530.   'New Info (1-10): 5'
  1531. ────────────────────────────────────────────────────────────────
  1532.  
  1533. GETLINE
  1534.  
  1535.   FUNCTION getline(len, tablen, color : BYTE);
  1536.  
  1537. Gets a line of input from the user with word wrapping.  If the
  1538. user hits the tab key, it is expanded to 'tablen'.  Word wrapping
  1539. occurs at 'len' and the text inputed is displayed in color
  1540. 'color'.  The variable 'scrap_entry' must be initialized before a
  1541. call to GETLINE.  'scrap_entry' is the previously wrapped string
  1542. from GETLINE and is displayed before input is accepted in the
  1543. GETLINE function.
  1544.  
  1545. Example:
  1546.   display(0, 7, 0, 'Type in 5 lines:');
  1547.   scrap_entry := '';
  1548.   FOR counter := 1 TO 5 DO
  1549.     msg[counter] := getline(75, 4, 10);
  1550.   FOR counter := 1 TO 5 DO
  1551.     display(0, 12, 0, msg[counter]);
  1552. ────────────────────────────────────────────────────────────────
  1553. GETPHONE
  1554.  
  1555.   FUNCTION getphone(style : BYTE) : STRING;
  1556.  
  1557. Inputs a USA or free-style format phone number including area
  1558. code.  This function automatically formats the user input field
  1559. depending on the 'style' used.  Valid 'style's are:
  1560.  
  1561.   0 : USA Format   (Area Code) Prefix-Suffix. The formatted                     
  1562. result returned is: ###-###-####
  1563.   1 : Free-Style - Stores input number as entered by the user.
  1564.                     Allows input of up to 18 characters including 
  1565.                     digits and dashes ('-').
  1566. ────────────────────────────────────────────────────────────────
  1567. INREADY
  1568.  
  1569.   FUNCTION inready : BOOLEAN;
  1570.  
  1571. Returns true if a key is in the input buffer.  Otherwise false is
  1572. returned.
  1573. ────────────────────────────────────────────────────────────────
  1574. PROMPT
  1575.  
  1576.   FUNCTION prompt(fore : BYTE; ptype : BYTE);
  1577.  
  1578. Displays one of the following prompt strings in color 'fore'.    
  1579.   'ptype' is one of the following:
  1580.      Type 1 = '==PAUSE=='
  1581.      Type 2 = 'More (Y/n)'
  1582.      Type 3 = 'More (Y/n/=)'
  1583.      Type 4 = 'Hit [Enter] to continue'
  1584.  
  1585. ────────────────────────────────────────────────────────────────
  1586.  
  1587.  
  1588.  
  1589. SETHOTKEYS_OFF;
  1590.  
  1591.   PROCEDURE sethotkeys_off;
  1592.  
  1593. Turns off hotkey usage.  The following variables are initiailized
  1594. upon a call to SETHOTKEYS_OFF.
  1595.  
  1596.   hotkeyon := FALSE;
  1597.   hotkeypressed := FALSE;
  1598.   range := [#0];
  1599.  
  1600. See Also: SETHOTKEYS_ON
  1601. ────────────────────────────────────────────────────────────────
  1602. SETHOTKEYS_ON;
  1603.  
  1604.   PROCEDURE sethotkeys_on(killkey : killer ; range : charset);
  1605.  
  1606. 'range' is a set of characters which are valid hot-keys.  These
  1607. should be specified in upper case format.  If any of the
  1608. specified characters are pressed, all display output is stopped
  1609. (nothing is echoed to the either the local or remote screens),
  1610. and the 'hotkeypressed' variable is set to TRUE.  Once this call
  1611. is made, the 'hotkeyon' variable is also set to TRUE.  If 'kill'
  1612. is specified in killkey, then the hot-key pressed is killed from
  1613. memory.    That is to say that it is not "remembered". If
  1614. 'nokill' was specified, the Hot-Key is "remembered" and will be
  1615. automatically returned to the next call to GETCHAR.  This is
  1616. intended for uses such as breaking out of a text file display.
  1617.  
  1618. Example:
  1619.    BEGIN
  1620.      sethotkeys_on(kill, ['A', 'S']);
  1621.      showfile(7, 0, 0, 'Disclamr', 'C:\Ra\TxtFile);
  1622.      sethotkeys_off;
  1623.    END;
  1624. The above example would display a BBS disclaimer and set the
  1625. hotkeys to 'A'bort and 'S'top.  If the user pressed those keys
  1626. during the display of the text file it would exit the showfile
  1627. procedure and continue in the calling part of the program.
  1628. ────────────────────────────────────────────────────────────────
  1629. String Function/Procedures
  1630. ───────────────────────────
  1631.  
  1632. ────────────────────────────────────────────────────────────────
  1633. BACKSPACE
  1634.  
  1635.   PROCEDURE backspace(ch : CHAR);
  1636.  
  1637. Writes a destructive backspace to the output buffer leaving 'ch'
  1638. behind.  If you would want to remove a character from the screen
  1639. and leave nothing behind, you would pass a null character to 'ch'
  1640. or a ' '.  The current screen colors are used to display 'ch'.
  1641.  
  1642. Example:
  1643.   sdisplay(0, 7, 0, 'Now you see this');
  1644.   getchar;
  1645.   FOR counter ;= 1 TO LENGTH('this') DO
  1646.     backspace(' ');
  1647.   sdisplay(0, 7, 0, 'something different!');
  1648. ────────────────────────────────────────────────────────────────
  1649. CENTER
  1650.  
  1651.   FUNCTION center(s : STRING; len : WORD) : STRING;
  1652.  
  1653. Centers 's' in the middle of 'len'.  's' is padded with ' ' to
  1654. the beginning of it.  No padding is done to the end of 's'.
  1655.  
  1656. See Also: CENTERFILL
  1657. ────────────────────────────────────────────────────────────────
  1658. CENTERFILL
  1659.  
  1660.   FUNCTION centerfill(s : STRING; len : WORD) : STRING;
  1661.  
  1662. Centers 's' in the middle of 'len' which will normally be the
  1663. users screen width.  's' is padded with ' ' to the beginning of
  1664. it.  Padding is done to the end of 's' with ' ' to make it a
  1665. length of 'len'.  This function is perfect for making a title
  1666. bar.
  1667.  
  1668. Example:
  1669.   clearscreen;
  1670.   display(1, 14, 0, centerfill('Welcome to BVDoor', 79));
  1671. This example would clear the screen and display 'Welcome to
  1672. BVDoor' in the middle of the screen on a blue background along
  1673. the whole line.
  1674. ────────────────────────────────────────────────────────────────
  1675. CHANGECASE
  1676.  
  1677.   FUNCTION changecase(s : STRING) : STRING;
  1678.  
  1679. Returns a string in upper case.
  1680.  
  1681. See Also: FORMATSTR
  1682. ────────────────────────────────────────────────────────────────
  1683.  
  1684.  
  1685.  
  1686. CKPATH
  1687.  
  1688.   FUNCTION ck_path(path : STRING) : STRING;
  1689.  
  1690. Checks to see if a pathname ends with a trailing backslash.  If
  1691. no backslash is present it is added, otherwise the path remains
  1692. unchanged.  This does not check to see if the path exists like
  1693. FIXPATH does. 
  1694.  
  1695. See Also: EXISTPATH, FIXPATH
  1696. ────────────────────────────────────────────────────────────────
  1697. COMMASTR
  1698.  
  1699.   FUNCTION commastr(int : LONGINT) : STRING;
  1700.  
  1701. Adds commas into a number to make it more readable.
  1702.  
  1703. Example:
  1704.   display(0, 7, 0, 'Did you know that ' + commastr(987654321) +
  1705.                       ' is a large number');
  1706.   Output would look like:
  1707.     Did you know that 987,654,321 is a large number
  1708. ────────────────────────────────────────────────────────────────
  1709. CURSORPOS
  1710.  
  1711.   PROCEDURE cursorpos(y, x : BYTE);
  1712.  
  1713. Moves the cursor position to row y, column x.  Exists if the y is
  1714. less than 0 or greater than 25 or if x is less than 0 or is
  1715. greater than 80.
  1716. ────────────────────────────────────────────────────────────────
  1717. DATESTR
  1718.  
  1719.   FUNCTION datestr : STRING;
  1720.  
  1721. Returns the current date as MM-DD-YY.
  1722.  
  1723. Example:
  1724.   display(0,15,0,'The Current Date Is ' + datestr);
  1725. ────────────────────────────────────────────────────────────────
  1726. FIXPATH
  1727.  
  1728.   FUNCTION fixpath(path : STRING) : STRING;
  1729.  
  1730. Calls the CKPATH function and then checks to see if the path
  1731. exists.  If the path does not exist a haltcode of 6 is returned.
  1732. ────────────────────────────────────────────────────────────────
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743. FORMATSTR
  1744.  
  1745.   FUNCTION formatstr(s : STRING) : STRING;
  1746.  
  1747. Shifts all the first letters of a word to uppercase and the rest
  1748. of the word to lowercase.
  1749.  
  1750. Example:
  1751.   s := formatstr('tHis iS aN eXamPLE);
  1752. The result would be:
  1753.   'This Is An Example'
  1754. ────────────────────────────────────────────────────────────────
  1755. GETWORDS
  1756.  
  1757.   FUNCTION getwords(numwords : INTEGER; s : STRING) : STRING;
  1758.  
  1759. Returns the first 'numwords' from 's'.  Words must be separated
  1760. by spaces.  If the number of words is less than 'numwords' then
  1761. the whole string is returned untouched.
  1762.  
  1763. Example:
  1764.   s := 'This contains only a couple words'
  1765.   s2 := getwords(3, s);
  1766.  
  1767. The result of 's2' would be:
  1768.   'This contains only'
  1769. ────────────────────────────────────────────────────────────────
  1770. LJUST
  1771.  
  1772.   FUNCTION ljust(s : STRING; wide : BYTE) : STRING;
  1773.  
  1774. Left justifies 's' to a length of 'wide'.  Padding is done with
  1775. adding ' ' to the end of 's' to make it 'wide' long.
  1776.  
  1777. Example:
  1778.   s := 'Hello';
  1779.   display(0, 7, 0, ljust(s, 10));
  1780.  
  1781. Output would be:
  1782.   'Hello    '
  1783.  
  1784. See Also: RJUST
  1785. ────────────────────────────────────────────────────────────────
  1786. LASTPOS
  1787.  
  1788.   FUNCTION lastpos(sub : STRING; s : STRING) : STRING;
  1789.  
  1790. Exaclty the same as the POS command, but returns the position of
  1791. the last found substring 'sub' in the string 's'.
  1792.  
  1793. Example:
  1794.   s := 'Hello hi, no hi, no Hello, hi? Huh??');
  1795.   display(0, 7, 0, 'Last pos of HI is:', itoa(lastpos('hi', s)));
  1796.  
  1797. Output would be:
  1798.   'The last pos of HI is: 28'
  1799. ────────────────────────────────────────────────────────────────
  1800. LEFTS
  1801.  
  1802.   FUNCTION lefts(s : STRING; charstokeep : INTEGER) : STRING;
  1803.  
  1804. Returns the first 'charstokeep' from string 's'.
  1805.  
  1806. Example:
  1807.   display(0, 7, 0, lefts('Welcome to BVDoor', 6));
  1808.  
  1809. Output would be:
  1810.     'Welcom'
  1811.  
  1812. See Also: RIGHTS
  1813. ────────────────────────────────────────────────────────────────
  1814. LTRIM
  1815.  
  1816.   FUNCTION ltrim(s : STRING) : STRING;
  1817.  
  1818. Removes the leading ' ' from 's';
  1819.  
  1820. Example:
  1821.   display(0, 7, 0, ltrim('      Hello   '));
  1822.  
  1823.   Output would be:
  1824.   'Hello   '
  1825.  
  1826. See Also: RTRIM
  1827. ────────────────────────────────────────────────────────────────
  1828. LOWCASE
  1829.  
  1830.   FUNCTION lowcase(ch : CHAR) : CHAR;
  1831.  
  1832. Converts a character to lower case.  Does the oppostite of the
  1833. UPCASE command.
  1834.  
  1835. See Also: CHANGECASE
  1836. ────────────────────────────────────────────────────────────────
  1837. MKSTRING
  1838.  
  1839.   FUNCTION mkstring(long : INTEGER; ch : CHAR) : STRING;
  1840.  
  1841. Makes a string of 'ch' of length 'long'.  Used for drawing
  1842. underlines and other things.
  1843.  
  1844. Example:
  1845.   display(0, 7, 0, mkstring(10, -));
  1846.  
  1847.   Output would be:
  1848.     '----------'
  1849. ────────────────────────────────────────────────────────────────
  1850. MORE
  1851.  
  1852.   PROCEDURE more(prompt : STRING; fg : BYTE);
  1853.  
  1854. Displays 'prompt' to the screen jusing a foreground color of
  1855. 'fg'.  This procedure also waits for a key to be pressed.
  1856. ────────────────────────────────────────────────────────────────
  1857. RIGHTS
  1858.  
  1859.   FUNCTION rights(s : STRING; charstokeep : INTEGER) : STRING;
  1860.  
  1861. Returns the first 'charstokeep' from string the end of 's'.
  1862.  
  1863. Example:
  1864.   s:= 'Welcome to BVDoor';
  1865.   display(0, 7, 0, rights(s, 5));
  1866.  
  1867.   Output would be:
  1868.     'VDoor'
  1869.  
  1870. See Also: LEFTS
  1871. ────────────────────────────────────────────────────────────────
  1872. RTRIM
  1873.  
  1874.   FUNCTION rtrim(s : STRING) : STRING;
  1875.  
  1876. Removes the trailing ' ' from 's';
  1877.  
  1878. Example:
  1879.   s := '   Hello  '
  1880.   display(0, 7, 0, rtrim(s));
  1881.  
  1882.   Output would be:
  1883.   '   Hello'
  1884.  
  1885. See Also: LTRIM
  1886. ────────────────────────────────────────────────────────────────
  1887. TIMESTR
  1888.  
  1889.   FUNCTION timestr : STRING;
  1890.  
  1891. Returns the current time as HH:MM:SS in 24 hour format.
  1892.  
  1893. Example:
  1894.   display(0, 15, 0, 'The Current Time Is ' + timestr);
  1895. ────────────────────────────────────────────────────────────────
  1896.  
  1897.  
  1898.  
  1899. Number/String Conversions
  1900. ──────────────────────────
  1901.  
  1902. ────────────────────────────────────────────────────────────────
  1903. ATOI
  1904.  
  1905.   FUNCTION atoi(s : STRING) : INTEGER;
  1906.  
  1907. Converts a string into an integer.
  1908. ────────────────────────────────────────────────────────────────
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914. BTOA
  1915.  
  1916.   FUNCTION btoa(bool : BOOLEAN) : STRING;
  1917.  
  1918. Returns 'TRUE' or 'FALSE' as a string depending on the state of
  1919. the boolean passed to it.
  1920.  
  1921. Example:
  1922.   VAR
  1923.     bool : BOOLEAN;
  1924.   BEGIN
  1925.     display(0, 7, 0, 'bool is true' + btoa(bool));
  1926.   END;
  1927. ────────────────────────────────────────────────────────────────
  1928. ITOA
  1929.  
  1930.   FUNCTION itoa(int : INTEGER) : STRING;
  1931.  
  1932. Converts an integer to a string.  Very convienent to use with the
  1933. display commands.
  1934.  
  1935. Example:
  1936.   display(0, 7, 0, 'Your ansi setting is: ' + itoa(ansi));
  1937. ────────────────────────────────────────────────────────────────
  1938. WTOA
  1939.  
  1940.   FUNCTION wtoa(num : INTEGER) : STRING;
  1941.  
  1942. Converts a variable of type WORD into a string.
  1943.  
  1944. See Also: ITOA
  1945. ────────────────────────────────────────────────────────────────
  1946. WTOH
  1947.  
  1948.   FUNCTION wtoh(num : WORD) : STRING;
  1949.  
  1950. Converts a number into it's hex form.
  1951.  
  1952. Example:
  1953.   display(0, 7, 0, 'Hex of 45 is: ' + wtoh(45));
  1954.   The above would display: 'Hex of 45 is: 002D'
  1955. ────────────────────────────────────────────────────────────────
  1956.  
  1957.  
  1958. File Routines
  1959. ──────────────
  1960.  
  1961. ────────────────────────────────────────────────────────────────
  1962. EXIST
  1963.  
  1964.   FUNCTION exist(filename : STRING) : BOOLEAN;
  1965.  
  1966. Returns true if a file on harddrive exists.  Pathnames included
  1967. with a filename are valid.
  1968.  
  1969. See Also: CKPATH, FIXPATH
  1970. ────────────────────────────────────────────────────────────────
  1971. EXISTPATH
  1972.  
  1973.   FUNCTION existpath(d : STRING) : BOOLEAN;
  1974.  
  1975. Tests to see if a fixed path exists.  If the path doesn't exist,
  1976. a return code of FALSE is returned, otherwise TRUE is returned.
  1977. ────────────────────────────────────────────────────────────────
  1978. DELETEFILE
  1979.  
  1980.   PROCEDURE deletefile(s : STRING);
  1981.  
  1982. Deletes a specified file.  If the file does not exist, no error
  1983. is returned.
  1984. ────────────────────────────────────────────────────────────────
  1985. SIZEFILE
  1986.  
  1987.   FUNCTION sizefile(s : STRING) : LONGINT;
  1988.  
  1989. Returns the total size of the file in bytes.  If the file does
  1990. not exist, a filesize of 0 is returned.  Remember, that files can
  1991. exist with only 0 bytes so you may want to use the EXIST command
  1992. on it first.
  1993.  
  1994. See Also: EXIST
  1995. ────────────────────────────────────────────────────────────────
  1996.  
  1997.  
  1998.  
  1999. Device (Modem/Pipe..) Routines
  2000. ───────────────────────────────
  2001.  
  2002. ────────────────────────────────────────────────────────────────
  2003. CARRIER
  2004.  
  2005.   FUNCTION carrier : BOOLEAN;
  2006.  
  2007. Checks to see if there is a carrier.  This function always
  2008. returns true if LOCAL is set to TRUE or if the variable
  2009. IGNORECARRIER is TRUE.
  2010.  
  2011. See Also: IGNORECARRIER, LOCAL
  2012. ────────────────────────────────────────────────────────────────
  2013. FLUSHCOMMBUFFER
  2014.  
  2015.   PROCEDURE flushcommbuffer;
  2016.  
  2017. This flushes out the input buffer so it is empty.  You may want
  2018. to use this before input routines so the user can not type ahead.
  2019. ────────────────────────────────────────────────────────────────
  2020. OUTPUTBUFEMPTY
  2021.  
  2022.   FUNCTION outputbufempty : BOOLEAN;
  2023.  
  2024. This checks to see if there is anything in the output buffer.  If
  2025. there is then this function will return FALSE, otherwise it will
  2026. return TRUE.
  2027. ────────────────────────────────────────────────────────────────
  2028. Time Limit Routines
  2029. ────────────────────
  2030.  
  2031. ────────────────────────────────────────────────────────────────
  2032. GET_TIME_LEFT
  2033.  
  2034.   PROCEDURE get_time_left(VAR min, sec);
  2035.  
  2036. This returns how much time left the user has in minutes and
  2037. seconds.
  2038. ────────────────────────────────────────────────────────────────
  2039. DECREASETIME
  2040.  
  2041.   PROCEDURE decreasetime;
  2042.  
  2043. Decreases the variable 'timeremaining' by 1 and checks to see if
  2044. it is 0.  If 'timeremaining' is 0 then CHKCONNECT will catch this
  2045. and terminate the program with a HALT(2).  CHKCONNECT is called
  2046. from inside this procedure.
  2047. ────────────────────────────────────────────────────────────────
  2048. INCREASETIME
  2049.  
  2050.   PROCEDURE increasetime;
  2051.  
  2052. Increases the variable 'timeremaining' by 1 and calls CHKCONNECT.
  2053. ────────────────────────────────────────────────────────────────
  2054.  
  2055.  
  2056.  
  2057. Multi-Node Routines
  2058. ────────────────────
  2059.  
  2060. ────────────────────────────────────────────────────────────────
  2061. CHKMSG
  2062.  
  2063.   FUNCTION chkmsg : BOOLEAN;
  2064.  
  2065.  
  2066. If CKMSGS, MULTINODE, and either QBBS275, QBBS276, RA110, or
  2067. RA200 is TRUE then BVDoor calls this function once a minute.  If
  2068. a message is waiting for the node that your door is running from,
  2069. the variable 'MSGWAITING' is set to TRUE.  If you are running
  2070. Remote Access, you must have the 'SEMAPHOREPATH' variable set to
  2071. RA's semaphore path or the current directory is scanned and you
  2072. won't be able to retrieve online messages.
  2073. ────────────────────────────────────────────────────────────────
  2074. GETMSG
  2075.  
  2076.   PROCEDURE getmsg;
  2077.  
  2078. If an online message is waiting for the current node, then the
  2079. message will be displayed.
  2080.  
  2081. See Also: CHKMSG, WAITINGMSG
  2082. ────────────────────────────────────────────────────────────────
  2083.  
  2084.  
  2085. GAMEINUSE
  2086.  
  2087.   FUNCTION gameinuse : BOOLEAN;
  2088.  
  2089. This function checks to see if 'INUSEFILE' isn't blank.  If
  2090. 'INUSEFILE' is blank this function exists with FALSE.  If
  2091. 'INUSEFILE' isn't blank and EXIST(inusefile) returns FALSE, then
  2092. a filename of 'INUSEFILE' is created and the function returns
  2093. FALSE.  If 'INUSEFILE' isn't blank and EXIST(inusefile) returns
  2094. TRUE, then it means that someone else is using the door.  BVDoor
  2095. then displays a message to the user saying that the door is in
  2096. use and returns TRUE.
  2097.  
  2098. Example:
  2099.   BEGIN
  2100.     inusefile := 'C:\Onlines\MyDoor\Inuse.Flg';
  2101.     IF gameinuse THEN
  2102.       HALT(0);
  2103.   END
  2104.  
  2105. If gameinuse returns TRUE, the program will continue.  If it
  2106. returns false, then the following message will be displayed:
  2107.  
  2108. productname ' is being use by another line.' Please try again
  2109. later...'
  2110. Hit ENTER to continue
  2111.  
  2112. See Also: GAMENOTINUSE
  2113. ────────────────────────────────────────────────────────────────
  2114. GAMENOTINUSE
  2115.  
  2116.   PROCEDURE gamenotinuse;
  2117.  
  2118. If 'inusefile' isn't blank and EXIST(inusefile) is true, then
  2119. 'inusefile' will be deleted and other users will be able to load
  2120. up the door.  YOU MUST call this procedure if you call GAMEINUSE,
  2121. otherwise nobody will be able to load up the door until
  2122. 'inusefile' is deleted!
  2123. ────────────────────────────────────────────────────────────────
  2124. MAXNODES
  2125.  
  2126.   FUNCTION maxnodes : BYTE;
  2127.  
  2128. This function scans the UserOn.BBS file in the 'exitinfopath' and
  2129. returns the maximum amount of nodes your BBS has.
  2130. ────────────────────────────────────────────────────────────────
  2131. USERONNODE
  2132.  
  2133.   FUNCTION useronnode(nodenum : BYTE) : namestr;
  2134.  
  2135. This function scans the UserOn.BBS file in the 'exitinfopath' and
  2136. returns the name of the user on node 'nodenum'.  If no one is on
  2137. the node, then the function will return ''.
  2138. ────────────────────────────────────────────────────────────────
  2139.  
  2140.  
  2141.  
  2142. WHOSON
  2143.  
  2144.   PROCEDURE whoson;
  2145.  
  2146. If MULTINODE, CKEXITINFO and either of RA200, RA110, QBBS275,
  2147. QBBS276, QBBS280 are true, then this procedure will display a
  2148. Remote Access style of the who's online screen.
  2149. ────────────────────────────────────────────────────────────────
  2150.  
  2151.  
  2152.  
  2153. User Record Routines
  2154. ─────────────────────
  2155. NOTE ** The EXITINFO.BBS File MUST be read in for these to work
  2156. UNLESS the 'SESSION.INFO' file was read in **
  2157.  
  2158. ────────────────────────────────────────────────────────────────
  2159. FLIPFLAG
  2160.  
  2161.   PROCEDURE flipflag(flag : flagset);
  2162.  
  2163. Toggles the flag passed to the procedure and updates the
  2164. exitinfo.bbs file.
  2165.  
  2166. Example:
  2167.   BEGIN
  2168.     ...
  2169.     flipflag(A1);
  2170.   END;
  2171. If the users A1 flag was off before the call, it would then be on
  2172. after the call to flipflag.
  2173. ────────────────────────────────────────────────────────────────
  2174. SETFLAG
  2175.  
  2176.   PROCEDURE setflag(flag : flagset; stat : on_off);
  2177.  
  2178. Changes the state of 'flag' to the passed variable 'stat' which
  2179. will be 'ison' or 'isoff'.  This updates the exitinfo.bbs file.
  2180.  
  2181. See Also: FLIPFLAG
  2182. ────────────────────────────────────────────────────────────────
  2183. SETSECURITY
  2184.  
  2185.   PROCEDURE setsecurity(sec : WORD);
  2186.  
  2187. Changes the users security level in the exitinfo.bbs file to
  2188. 'sec'.
  2189. ────────────────────────────────────────────────────────────────
  2190.  
  2191. SETSUBDATE
  2192.  
  2193.   PROCEDURE setsubdate(sub : ra_date);
  2194.  
  2195. Sets the users subscription date in the exitinfo.bbs file to
  2196. 'sub'.
  2197. ────────────────────────────────────────────────────────────────
  2198.  
  2199. RA Specific Routines
  2200. ─────────────────────
  2201.  
  2202. ────────────────────────────────────────────────────────────────
  2203. CHKRAXIT
  2204.  
  2205.   FUNCTION chkraxit : BOOLEAN;
  2206.  
  2207. Checks to see if the sysop has forced the node down with the
  2208. semaphore file RAXIT'nodenum'.???.  If the file exists, then
  2209. CHKRAXIT returns TRUE.
  2210. ────────────────────────────────────────────────────────────────
  2211. POSTMSG
  2212.  
  2213.   PROCEDURE postmsg(long : BYTE; msgpath : STRING);
  2214.  
  2215. This function exists if both of the variables RA200 AND RA110 are
  2216. FALSE.  This function writes a message in the RA message base. 
  2217. The actual message text is you want to write is stored in the
  2218. varible MSGBUFF which is a global array (msgbuff : ARRAY[1.100]
  2219. OF STRING[80]).
  2220.  
  2221. Fill 'msgbuff' with the message starting with msgbuff[1] as
  2222. msgbuff[0] is used internally to add a product ID kludge line in
  2223. the message.  You MUST make sure to add a character 13 (Carriage
  2224. Return) to the end of each line, include blank lines.  The passed
  2225. variable of 'long' is the number of lines long your message is.
  2226. If the last line of your message is msgbuff[6] then pass 6 to the
  2227. postmsg call.  'msgpath' is the path to the RA message base.  If
  2228. successful, postmsg will return a 0, if not, -100
  2229.  
  2230. 'postmsg' will determine the correct message number for the
  2231. system, but you are required to fill out the remaining part of
  2232. the structure.
  2233.  
  2234.   msghdrrecord = RECORD
  2235.         destnet,
  2236.         destnode,
  2237.         orignet,
  2238.         orignode : WORD;
  2239.         destzone,
  2240.         origzone : BYTE;
  2241.         cost : WORD;
  2242.         msgattr,
  2243.         netattr,
  2244.         board : BYTE;
  2245.         posttime : ra_time;
  2246.         postdate : ra_date;
  2247.         whoto,
  2248.         whofrom : namestr;
  2249.         subject : String[72];
  2250.      END;
  2251. The global variable that is assigned to this record is:
  2252.    hdr : msghdrrecord;
  2253.  
  2254.  
  2255.  
  2256. Example:
  2257.  
  2258. PROCEDURE post_sysop_msg;
  2259.   BEGIN
  2260.     clearscreen;
  2261.     Display(0,15,0,'Writing a Message to the Sysop!');
  2262.     WITH hdr DO
  2263.       BEGIN
  2264.         whoto     := formatstr('Sysop');
  2265.         whofrom   := username;
  2266.         subject   := 'BBS Door';
  2267.         board     := 1;       (* Sysop Area *)
  2268.         postdate  := datestr;
  2269.         posttime  := timestr;
  2270.         destnet   := 0;
  2271.         destnode  := 0;
  2272.         orignet   := 0;
  2273.         orignode  := 0;
  2274.         destzone  := 0;
  2275.         origzone  := 0;
  2276.         cost      := 0;
  2277.         msgattr   := msg_local;
  2278.         netattr   := 0;
  2279.       END;
  2280.     msgbuff[1] := 'Dear Sysop Person'#13;
  2281.     msgbuff[2] := '' + #13;
  2282.     msgbuff[3] := ' I was just writing you a message to see how'
  2283.                          + ' it works'#13;
  2284.     msgbuff[4] := ' when you write it from inside a BVDoor'                          + '                      +
  2285.                   ' program'#13;
  2286.     msgbuff[5] := ' It isn't hard at all. :)'#13;
  2287.     msgbuff[6] := ''#13
  2288.     msgbuff[7] := '   Regards'+ #13;
  2289.     msgbuff[8] := '     ' + username + #13;
  2290.     crlf;
  2291.     display(0, 14, 0,'Posting message');
  2292.     postmsg(8, 'C:\Ra\MsgBase');
  2293.   END;
  2294. ────────────────────────────────────────────────────────────────
  2295. TIMETOEVENT
  2296.  
  2297.   FUNCTION timetoevent : INTEGER;
  2298.  
  2299. This returns how many minutes until the next system event.  This
  2300. procedure reads in the events.ra file in the 'exitinfopath'
  2301. directory and then calculates how many minutes there are until
  2302. the next event.  If the the event data file can't be found, then
  2303. this function returns a -1.
  2304. ────────────────────────────────────────────────────────────────
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313. DOCONVERT
  2314.  
  2315.   PROCEDURE doconvert;
  2316.  
  2317. This is the procedure that reads in the ExitInfo.BBS files.  This
  2318. procedure checks to see what format of ExitInfo.BBS and converts
  2319. it to the RA 2.xx format if it is not already.  If the
  2320. ExitInfo.BBS file was converted, then the variable
  2321. 'exitconverted% is set to TRUE.  Upon exit of the program, the
  2322. files are rewritten back into the original form with any updated
  2323. information from you door program.  The following variables are
  2324. set when this procedure is called from GETDORINFO: 
  2325.   ra200, ra110, qbbs275, qbbs276, qbbs280, adept175.
  2326.  
  2327. See Also: GETDORINFO
  2328. ────────────────────────────────────────────────────────────────
  2329. GETDORINFO
  2330.  
  2331.   PROCEDURE getdorinfo(nodenum : STRING; exitpath : STRING);
  2332.  
  2333. This is probably the most important procedure in the whole
  2334. package.  This procedure reads in the drop files and initializes
  2335. all the system and user variables.  If 'forcenode' is true (which
  2336. is default), then GETDORINFO will read in the 'DORINFO1.DEF'
  2337. only; no acceptions.  If you set the variable 'forcenode' to
  2338. false, then GETDORINFO will read in the 'DORINFOx.DEF where 'x'
  2339. is the nodenum passed.  If a 'DORINFO' file is read in, then the
  2340. ExitInfo.BBS file is automatically read in unless the variable
  2341. 'ckexitinfo' is false.  IF 'ckexitinfo' is true, the 'DORINFO'
  2342. file was readin and the ExitInfo.BBS was not found, then a
  2343. haltcode of 5 is called.  If you wish to read in a Door.Sys file,
  2344. then set the variable 'doorsys' to TRUE BEFORE you call
  2345. GETDORINFO.  If you wish to read in a 'Session.Info' file
  2346. (AdeptXBBS) then set the variable 'sessioninfo' to TRUE BEFORE
  2347. you call GETDORINFO.  If you read in the 'Door.Sys' file,
  2348. ckexitinfo is true and the ExitInfo.BBS file is not found, then
  2349. no error is created as some BBS packages only create a Door.Sys
  2350. file.  If the ExitInfo.BBS file is found then you just have more
  2351. information you can change.  No harm done! 
  2352.  
  2353. Example:
  2354.   BEGIN
  2355.     node := '000005';
  2356.     getdorinfo(node, 'C:\Ra');
  2357.   END.
  2358. The above is a standard call to GETDORINFO.  It will only read in
  2359. Dorinfo1.Def as 'forcenode' is TRUE by default.
  2360.  
  2361. Example:
  2362.   BEGIN
  2363.     forcenode := FALSE;
  2364.     node := '000005';
  2365.     getdorinfo(node, 'C:\Ra');
  2366.   END.
  2367. The above is a standard call to GETDORINFO.  It will read in
  2368. Dorinfo5.Def because 'forcenode' is false.
  2369.  
  2370.   VAR
  2371.     node : STRING;
  2372.   BEGIN
  2373.     node := '1';
  2374.     doorsys := TRUE;
  2375.     getdorinfo(node, 'C:\Ra\Node1');
  2376.   END.
  2377. The above reads in the 'Door.Sys' file from the '\Ra\Node1' path
  2378. because the variable 'doorsys' is set to TRUE.
  2379.  
  2380.   VAR
  2381.     node : STRING;
  2382.   BEGIN
  2383.     sessioninfo := TRUE;
  2384.     node := '000001';
  2385.     getdorinfo(node, 'C:\Ra');
  2386.   END.
  2387.  
  2388. The above reads in the 'Session.Info' drop file.
  2389. ────────────────────────────────────────────────────────────────
  2390. BV_LOG
  2391.  
  2392.   PROCEDURE bv_log(debug_txt : STRING);
  2393.  
  2394. This procedure writes 'debug_txt' into a file named:
  2395. DEBUG'thisnode'.LOG if the variable 'bvdebug' is TRUE.  If
  2396. 'bvdebug' is false, then the procedure exits and nothing is
  2397. written into the logfile.
  2398. ────────────────────────────────────────────────────────────────
  2399. GETNODE
  2400.  
  2401.   FUNCTION getnode : BYTE;
  2402.  
  2403. This function takes a look at the variable 'thisnode' and returns
  2404. it back as a BYTE.
  2405.  
  2406. Example:
  2407.   BEGIN
  2408.     FOR counter := 1 TO getnode DO
  2409.       display(0, 14, 0, 'User on node ' + itoa(counter) + ':' +
  2410.                          useronnode(counter));
  2411.   END.
  2412. ────────────────────────────────────────────────────────────────
  2413. SHOW_STATUS
  2414.  
  2415.   PROCEDURE show_status;
  2416.  
  2417. If the variable 'statuslineon' is true, then the status line will
  2418. be forced to redraw itself.
  2419. ────────────────────────────────────────────────────────────────
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427. DESQVIEW_ACTIVE
  2428.  
  2429.   PROCEDURE destview_active;
  2430.  
  2431. This function takes a look at the operating system and updates
  2432. the following variables on it's findings:
  2433.    os2
  2434.    dosver
  2435.    dv
  2436.    dvver
  2437.    fourdos
  2438.    nwver
  2439.    winver
  2440. ────────────────────────────────────────────────────────────────
  2441.  
  2442.  
  2443.  
  2444. Only For Compatablity
  2445. ──────────────────────
  2446.  
  2447. ────────────────────────────────────────────────────────────────
  2448. The following routines are not implemented because of porting
  2449. problems.  If you really need one of these routines implemented,
  2450. then please contact us at BV Compuworks Group.
  2451.  
  2452. FUNCTION  unlock(VAR df : FILE; startblock, 
  2453.                     lenblock : LONGINT) : WORD;
  2454. FUNCTION  lock(VAR df : FILE; startblock, 
  2455.                     lenblock : LONGINT) : WORD;
  2456. PROCEDURE set_retries(lockretries, delay : INTEGER);
  2457. FUNCTION  setfossil : BOOLEAN;
  2458. FUNCTION  setflaguser(path : pathstr;
  2459.                user : namestr; onoff : on_off) : BYTE;
  2460. PROCEDURE showfilesbbs(VAR lncount : INTEGER; n, pause, 
  2461.                          fc,sc,dc, ec, mc,bc : BYTE; 
  2462.                          fpath, fn : STRING; 
  2463.                          VAR cont: BOOLEAN;
  2464.                          oneline : BOOLEAN);
  2465. FUNCTION  share : BOOLEAN;
  2466. PROCEDURE deposittime(path, name : STRING; depnum : INTEGER);
  2467. PROCEDURE clearregs;
  2468. ────────────────────────────────────────────────────────────────
  2469.  
  2470. BVDoor CONST Section:
  2471.      maxport    = 255;    { Max Com Ports Supported     }
  2472.      bvdversion = '1.0';  { BVDoor Version              }
  2473.      compiled   = 'Compiled on thisday';
  2474.                           { Date BVDoor was compiled    }
  2475.       beta      = FALSE;  { True in Beta versions       }
  2476.       ansicls   =  #27 + '[40m' + #27 + '[2J';  
  2477.                           { Ansi Codes to clear screen  }
  2478.       maxkeys   =  20;    { Max User keys supported     }
  2479.       lockmde   =  64 + 2;    
  2480.                           { File Locking opens files as }
  2481.                           { Shared/Read/Write           }
  2482.       softcr    = #141;   { Use this in messages for CR }
  2483.       cr        = #13;    { Carriage Return             }
  2484.  
  2485. (* The Following are Used in PostMsg attributes *)
  2486. msg_delete  = 1; { (Attr AND  1) =  msg deleted }
  2487. msg_out_net = 2; { (Attr AND  2) =  netmail to be scanned out}
  2488. msg_net     = 4; { (Attr AND  4) =  Netmail Message }
  2489. msg_private  =  8; { (Attr AND 8) = Private Message }
  2490. msg_received = 16; { (Attr AND 16) = Message Received}
  2491. msg_out_echo = 32; { (Attr AND 32) = Echomail to be scanned out }
  2492. msg_local = 64; { (Attr AND 64) =  ALWAYS SET msg typed locally}
  2493.  
  2494. BVDoor TYPE Section:
  2495.  
  2496.      pathstr   = STRING[79];
  2497.      statstr   = STRING[79];
  2498.      str18     = STRING[18];
  2499.      str5      = STRING[5];
  2500.      str2      = STRING[2];
  2501.      str1      = STRING[1];
  2502.      namestr   = STRING[35];
  2503.      charset   = SET OF CHAR;
  2504.      flagset   = (A0, A1, A2, A3, A4, A5, A6, A7, A8,
  2505.                     B1, B2, B3, B4, B5, B6, B7, B8,
  2506.                     C1, C2, C3, C4, C5, C6, C7, C8,
  2507.                     D1, D2, D3, D4, D5, D6, D7, D8);
  2508.      on_off    = (null, ison, off);
  2509.      killer    = (kill, nokill);
  2510.      cardsuit  = (C,D,H,S);
  2511.  
  2512.      asktype        = (yes, no, ask, only);
  2513.      videotype      = (auto, short, long);
  2514.      msgkindstype   = (both, private, public, ronly);
  2515.  
  2516.      msgtxt = RECORD
  2517.           line : STRING[255];
  2518.        END;
  2519.  
  2520.      msgtoidx = RECORD
  2521.           user : STRING[35];
  2522.        END;
  2523.  
  2524.      msgtype        = (localmail, netmail, echomail);
  2525.      orphantype     = (ignore, create, ra_kill);
  2526.      flagtype       = ARRAY[1..4] OF BYTE;
  2527.      ra_time        = STRING[8];
  2528.      ra_date        = STRING[8];
  2529.      longdate       = STRING[9];
  2530.      netaddress = RECORD
  2531.           zone,
  2532.           net,
  2533.           node,
  2534.           point : WORD;
  2535.        END;
  2536.  
  2537.  
  2538.      languagerecord = RECORD
  2539.           name      : STRING[20];
  2540.           attribute : BYTE;
  2541.           defname,
  2542.           menupath,
  2543.           textpath,
  2544.           quespath  : STRING[60];
  2545.           freespace : ARRAY[1..200] OF BYTE;
  2546.        END;
  2547.  
  2548.      msginforecord = RECORD
  2549.           lowmsg,
  2550.           highmsg,
  2551.           totalmsgs    : WORD;
  2552.           totalonboard : ARRAY[1..200] OF WORD;
  2553.        END;
  2554.  
  2555.      msgidxrecord = RECORD
  2556.           msgnum : INTEGER;
  2557.           board  : BYTE;
  2558.        END;
  2559.  
  2560.      msgtoidxrecord = STRING[35];
  2561.  
  2562.      msghdrrecord = RECORD
  2563.           msgnum     : INTEGER;
  2564.           prevreply,
  2565.           nextreply,
  2566.           timesread  : WORD;
  2567.           startblock : WORD;
  2568.           numblocks,
  2569.           destnet,
  2570.           destnode,
  2571.           orignet,
  2572.           orignode   : WORD;
  2573.           destzone,
  2574.           origzone   : BYTE;
  2575.           cost       : WORD;
  2576.           msgattr,
  2577.           netattr,
  2578.           board      : BYTE;
  2579.           posttime   : ra_time;
  2580.           postdate   : ra_date;
  2581.           whoto,
  2582.           whofrom    : msgtoidxrecord;
  2583.           subject    : STRING[72];
  2584.        END;
  2585.      msgtxtrecord = STRING[255];
  2586.  
  2587.      (* RemoteAccess v1.1x UserOn.BBS *)
  2588.      useron110record = RECORD
  2589.           name         : msgtoidxrecord;
  2590.           handle       : msgtoidxrecord;
  2591.           line         : BYTE;
  2592.           baud         : WORD;
  2593.           city         : STRING[25];
  2594.           donotdisturb : BOOLEAN;
  2595.           status       : BYTE;
  2596.           attribute    : BYTE;
  2597.        END;
  2598.  
  2599.      (* RemoteAccess 1.00 UserOn.BBS *)
  2600.      useron100record = RECORD
  2601.           name         : msgtoidxrecord;
  2602.           line         : BYTE;
  2603.           baud         : WORD;
  2604.           city         : STRING[25];
  2605.           donotdisturb : BOOLEAN;
  2606.           status       : BYTE;
  2607.        END;
  2608.  
  2609. (* 
  2610.    Remote Access Status Byte - 
  2611.      0 : Browsing the BBS (In a Menu)
  2612.      1 : Uploading/Downloading
  2613.      2 : Reading/posting messages
  2614.      3 : In a door/external program
  2615.      4 : Answering questionnaire
  2616. *)
  2617.  
  2618.  
  2619.      (* QBBS 2.75 UserOn.BBS *)
  2620.      q_useronrecord = RECORD
  2621.           name         : STRING[35];
  2622.           line         : BYTE;
  2623.           baud         : WORD;
  2624.           city         : STRING[35];
  2625.           donotdisturb : BOOLEAN;
  2626.        END;
  2627.  
  2628.      (* Remote Access v1.10 LastCall.BBS *)
  2629.      lastcall110 = RECORD
  2630.           line      : BYTE;
  2631.           name      : msgtoidxrecord;
  2632.           handle    : msgtoidxrecord;
  2633.           city      : STRING[25];
  2634.           baud      : WORD;
  2635.           times     : LONGINT;
  2636.           logon     : STRING[5];
  2637.           logoff    : STRING[5];
  2638.           attribute : BYTE;         (* Byte 0 : Hidden *)
  2639.        END;
  2640.  
  2641.  
  2642.      (* RemoteAccess v1.00 /QBBS Lastcall.BBS *)
  2643.      lastcallrecord = RECORD
  2644.           line   : BYTE;
  2645.           name   : msgtoidxrecord;
  2646.           city   : STRING[25];
  2647.           baud   : WORD;
  2648.           times  : LONGINT;
  2649.           logon  : STRING[5];
  2650.           logoff : STRING[5];
  2651.        END;
  2652.  
  2653.                
  2654.      combinedrecord = ARRAY[1..200] OF WORD;
  2655.  
  2656.      usersidxrecord = RECORD
  2657.           namecrc32,
  2658.           handlecrc32    : LONGINT;
  2659.        END;
  2660.  
  2661.      uline = RECORD
  2662.           name         : STRING[35];
  2663.           handle       : STRING[35];
  2664.           line         : INTEGER;
  2665.           baud         : WORD;
  2666.           city         : STRING[25];
  2667.           calls        : WORD;
  2668.           doing        : STRING[20];
  2669.           hidden       : BOOLEAN;
  2670.           wantschat    : BOOLEAN;
  2671.           ranetmgr     : BOOLEAN;
  2672.           donotdisturb : BOOLEAN;
  2673.           ready        : BOOLEAN;
  2674.           msgwaiting   : BOOLEAN;
  2675.        END;
  2676.  
  2677.  
  2678.      bytearray32 = ARRAY[1..32] OF BYTE;
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.      useronrecord = RECORD
  2700.           name,
  2701.           handle    : msgtoidxrecord;
  2702.           line      : BYTE;
  2703.           baud      : WORD;
  2704.           city      : STRING[25];
  2705.           status,
  2706.           attribute : BYTE;
  2707.           statdesc  : STRING[10];
  2708.           freespace : ARRAY[1..98] OF BYTE;
  2709.           nocalls   : WORD;
  2710.        END;
  2711. (*
  2712.       Status byte - 
  2713.      0 : Browsing (in a menu)                
  2714.      1 : Uploading/downloading
  2715.      2 : Reading/posting messages  
  2716.      3 : In a door/external utility                                    
  2717.      4 : Chatting with sysop                 
  2718.      5 : Answering questionnaire
  2719.      6 : RTC
  2720.      7 : New user logon
  2721.    255 : User-defined - display StatDesc
  2722.      
  2723.      Attribute - 
  2724.   Bit 0 : Hidden
  2725.       1 : Wants chat
  2726.       2 : Reserved for RANETMGR
  2727.       3 : Do not disturb flag
  2728.       6 : Ready (0=busy)
  2729. *)
  2730.  
  2731. (* RA 2.0x User Record *)
  2732.      usersrecord = RECORD
  2733.           name           : msgtoidxrecord;
  2734.           location       : STRING[25];
  2735.           organisation, 
  2736.           address1, 
  2737.           address2,
  2738.           address3       : STRING[50];
  2739.           handle         : STRING[35];
  2740.           comment        : STRING[80];
  2741.           passwordcrc    : LONGINT;
  2742.           dataphone,
  2743.           voicephone     : STRING[15];
  2744.           lasttime       : ra_time;
  2745.           lastdate       : ra_date;
  2746.           attribute      : BYTE;   
  2747. (*    Bit 0 : Deleted
  2748.           1 : Clear screen
  2749.           2 : More prompt
  2750.           3 : ANSI
  2751.           4 : No-kill
  2752.           5 : Xfer priority
  2753.           6 : Full screen msg editor 
  2754.           7 : Quiet mode
  2755. *)
  2756.           attribute2     : BYTE;
  2757.  
  2758. (*    Bit 0 : Hot-keys
  2759.           1 : AVT/0
  2760.           2 : Fullscreen msg viewer
  2761.           3 : Hidden from userlist
  2762.           4 : Page priority
  2763.           5 : No echomail in mailbox scan
  2764.           6 : Guest account
  2765.           7 : Post bill enabled }
  2766. *)
  2767.           flags          : flagtype;
  2768.           credit,
  2769.           pending        : LONGINT;
  2770.           msgsposted,
  2771.           security       : WORD;
  2772.           lastread, 
  2773.           nocalls,
  2774.           uploads,
  2775.           downloads,
  2776.           uploadsk,
  2777.           downloadsk,
  2778.           todayk         : LONGINT;
  2779.           elapsed        : INTEGER;
  2780.           screenlength   : WORD;
  2781.           lastpwdchange  : BYTE;
  2782.           group          : WORD;
  2783.           combinedinfo   : combinedrecord;
  2784.           firstdate,
  2785.           birthdate,
  2786.           subdate        : ra_date;
  2787.           screenwidth,
  2788.           language,
  2789.           dateformat     : BYTE;
  2790.           forwardto      : STRING[35];
  2791.           msgarea,
  2792.           filearea       : WORD;
  2793.           defaultprotocol: CHAR;
  2794.           filegroup      : WORD;
  2795.           lastdobcheck   : BYTE;
  2796.           sex            : BYTE;
  2797.           xirecord       : LONGINT;
  2798.           msggroup       : WORD;
  2799.           freespace      : ARRAY[1..48] OF BYTE;
  2800.        END;
  2801.  
  2802.      usersxirecord  = RECORD
  2803.           freespace : ARRAY[1..200] OF BYTE;
  2804.        END;
  2805.  
  2806.      sysinforecord  = RECORD
  2807.           totalcalls : LONGINT;
  2808.           lastcaller : msgtoidxrecord;
  2809.           extraspace : ARRAY[1..128] OF BYTE;
  2810.        END;
  2811.  
  2812.  
  2813.      timelogrecord  = RECORD
  2814.           startdate   : ra_date;
  2815.           busyperhour : ARRAY[0..23] OF WORD;
  2816.           busyperday  : ARRAY[0..6] OF WORD;
  2817.        END;
  2818.  
  2819.      eventrecord = RECORD
  2820.           status : BYTE; (* 0=Deleted 1=Enabled 2=Disabled *)
  2821.           starttime   : ra_time;
  2822.           errorLevel  : BYTE;
  2823.           days        : BYTE;
  2824.           forced      : BOOLEAN;
  2825.           lasttimerun : ra_date;
  2826.        END;
  2827.  
  2828.      eventrecordarray = ARRAY[1..20] OF eventrecord;
  2829.  
  2830.      messagerecord  = RECORD
  2831.           unused    : ARRAY[1..4] OF BYTE;
  2832.           name      : STRING[40];
  2833.           typ       : msgtype;
  2834.           msgkinds  : msgkindstype;
  2835.           attribute : BYTE;
  2836. (*   
  2837.       Bit 0 : Enable EchoInfo
  2838.           1 : Combined access
  2839.           2 : File attaches
  2840.           3 : Allow aliases
  2841.           4 : Use SoftCRs as characters
  2842.           5 : Force handle
  2843.           6 : Allow deletes
  2844.           7 : Is a JAM area
  2845. *)
  2846.  
  2847.           dayskill,  (* Kill older than 'x' days *)
  2848.           recvkill       : BYTE; 
  2849. (* 
  2850.       Kill recv msgs, recv for more than 'x' days 
  2851. *)
  2852.           countkill      : WORD;
  2853.           readsecurity   : WORD;
  2854.           readflags,
  2855.           readnotflags   : flagtype;
  2856.           writesecurity  : WORD;
  2857.           writeflags,
  2858.           writenotflags  : flagtype;
  2859.           sysopsecurity  : WORD;
  2860.           sysopslags,
  2861.           sysopnotflags  : flagtype;
  2862.           originline     : STRING[60];
  2863.           akaaddress     : BYTE;
  2864.           age            : BYTE;
  2865.           jambase        : STRING[60];
  2866.           group          : WORD;
  2867.           altgroup       : ARRAY[1..3] OF WORD;
  2868.  
  2869.  
  2870.           attribute2     : BYTE;
  2871. (*
  2872.       Bit 0 : Include in all groups
  2873. *)
  2874.           freespace            : ARRAY[1..9] OF BYTE;
  2875.        END;
  2876.  
  2877.      exitinforecord = RECORD
  2878.           baud             : WORD;
  2879.           sysinfo          : sysinforecord;
  2880.           timeloginfo      : timelogrecord;
  2881.           userinfo         : usersrecord;
  2882.           eventinfo        : eventrecord;
  2883.           netmailentered,
  2884.           echomailentered  : BOOLEAN;
  2885.           logintime        : ra_time;
  2886.           logindate        : ra_date;
  2887.           timelimit        : WORD;
  2888.           loginsec         : LONGINT;
  2889.           userrecord       : INTEGER;
  2890.           readthru,
  2891.           numberpages,
  2892.           downloadlimit    : WORD;
  2893.           timeofcreation   : ra_time;
  2894.           logonpasswordcrc : LONGINT;
  2895.           wantchat                  : BOOLEAN;
  2896.           deductedtime     : INTEGER;
  2897.           menustack        : ARRAY[1..50] OF STRING[8];
  2898.           menustackpointer : BYTE;
  2899.           userxiinfo       : usersxirecord;
  2900.           errorfreeconnect,
  2901.           sysopnext        : BOOLEAN;
  2902.  
  2903. (* These  next fields hold
  2904.    data related to an
  2905.    EMSI session
  2906. *)
  2907.           emsi_session     : BOOLEAN;             
  2908.           emsi_crtdef,
  2909.           emsi_protocols,
  2910.           emsi_capabilities,
  2911.           emsi_requests,
  2912.           emsi_software    : STRING[40];
  2913.  
  2914.           hold_attr1,
  2915.           hold_attr2,
  2916.           hold_len         : BYTE;
  2917.           pagereason       : STRING[80];
  2918.           statusline       : BYTE;
  2919.           lastcostmenu     : STRING[8];
  2920.           menucostpermin   : WORD;
  2921.           doesavt,
  2922.           ripmode          : BOOLEAN;
  2923.           extraspace       : ARRAY[1..86] OF BYTE;
  2924.        END;
  2925.  
  2926.  
  2927. (* QBBS STRUCTURES *)
  2928.  
  2929.      qbbs275_flagtype = ARRAY[1..4] OF BYTE;
  2930.  
  2931.      qbbs275_userrecord = record
  2932.           name        : STRING[35];
  2933.           city        : STRING[25];
  2934.           pwd         : STRING[15];
  2935.           dataphone,
  2936.           homephone   : STRING[12];
  2937.           lasttime    : STRING[5];
  2938.           lastdate    : STRING[8];
  2939.           attrib      : BYTE;
  2940.           flags       : qbbs275_flagtype;
  2941.           credit,
  2942.           pending,
  2943.           timesposted,
  2944.           highmsgread,
  2945.           seclvl,
  2946.           times,
  2947.           ups,
  2948.           downs,
  2949.           upk,
  2950.           downk,
  2951.           todayk      : WORD;
  2952.           elapsed,
  2953.           len         : INTEGER;
  2954.           combinedptr : WORD; (* Record number in COMBINED.BBS *)
  2955.           aliasptr    : WORD; (* Record number in ALIAS.BBS                                                              *)
  2956.           birthday    : LONGINT;
  2957.        END;
  2958.                          
  2959. (*   Attrib:
  2960.        Bit 0: Deleted
  2961.        Bit 1: Screen Clear Codes
  2962.        Bit 2: More Prompt
  2963.        Bit 3: ANSI
  2964.        Bit 4: No-Kill
  2965.        Bit 5: Ignore Download Hours
  2966.        Bit 6: ANSI Full Screen Editor
  2967.        Bit 7: Sex (0=male, 1=female)
  2968. *)
  2969.  
  2970.      qbbs275_sysinforecord = RECORD
  2971.           callcount  : LONGINT;
  2972.           lastcaller : STRING[35];
  2973.           extraspace : ARRAY[1..128] OF BYTE;
  2974.        END;
  2975.  
  2976.      qbbs275_timelogrecord = RECORD
  2977.           startdate   : STRING[8];
  2978.           busyperhour : ARRAY[0..23] OF INTEGER;
  2979.           busyperday  : ARRAY[0..6] OF INTEGER;
  2980.        END;
  2981.  
  2982.      qbbs275_eventstat = (deleted, enabled, disabled);
  2983.  
  2984.      qbbs275_eventrecord = RECORD (* EVENTCFG.DAT *)
  2985.           status      : qbbs275_eventstat;
  2986.           runtime     : LONGINT;
  2987.           errorlevel  : BYTE;
  2988.           days        : BYTE;
  2989.           forced      : BOOLEAN;
  2990.           lasttimerun : LONGINT;
  2991.           spare       : ARRAY[1..7] OF BYTE;
  2992.        END;
  2993.  
  2994.      qbbs275_gosubdatatype = ARRAY[1..20] OF STRING[8];
  2995.  
  2996.      qbbs275_exitinforecord = RECORD
  2997.           baudrate       : INTEGER;
  2998.           sysinfo        : qbbs275_sysinforecord;
  2999.           timeloginfo    : qbbs275_timelogrecord;
  3000.           userinfo       : qbbs275_userrecord;
  3001.           eventinfo      : qbbs275_eventrecord;
  3002.           netmailentered : BOOLEAN;
  3003.           echomailentered: BOOLEAN;
  3004.           logintime      : STRING[5];
  3005.           logindate      : STRING[8];
  3006.           tmlimit        : INTEGER;
  3007.           loginsec       : LONGINT;
  3008.           credit         : LONGINT;
  3009.           userrecnum     : INTEGER;
  3010.           readthru       : INTEGER;
  3011.           pagetimes      : INTEGER;
  3012.           downlimit      : INTEGER;
  3013.           wantchat       : BOOLEAN;
  3014.           gosublevel     : BYTE;
  3015.           gosubdata      : qbbs275_gosubdatatype;
  3016.           menu           : STRING[8];
  3017.        END;
  3018.  
  3019.