home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 270.img / FORUM25C.ZIP / PCBOARD.PAS < prev    next >
Pascal/Delphi Source File  |  1989-02-24  |  9KB  |  241 lines

  1. {$R-,S-,I-,D-,F-,V-,B-,L+ }
  2. {$M 65500,0,0 }
  3.  
  4. unit pcboard;
  5.  
  6. interface
  7.  
  8. uses crt,dos,
  9.      gentypes,
  10.      Subs1;
  11.  
  12. Procedure Definefiles;
  13.  
  14. implementation
  15.  
  16. Type Single_87 = System.Single;
  17.  
  18. Procedure Def_pcbFile;
  19. type
  20.  
  21.    anystring = string[128];
  22.    longstring = string[255];
  23.  
  24.    string2   = string[2];
  25.    string8   = string[8];
  26.    string12  = string[12];
  27.    string13  = string[13];
  28.    string20  = string[20];
  29.    string30  = string[30];
  30.    string65  = string[65];
  31.    string72  = string[72];
  32.    string160 = string[160];
  33.    string255 = string[255];
  34.  
  35.    char2  = array[1..2] of char;
  36.    char3  = array[1..3] of char;
  37.    char4  = array[1..4] of char;
  38.    char5  = array[1..5] of char;
  39.    char6  = array[1..6] of char;
  40.    char7  = array[1..7] of char;
  41.    char8  = array[1..8] of char;
  42.    char9  = array[1..9] of char;
  43.    char10 = array[1..10] of char;
  44.    char11 = array[1..11] of char;
  45.    char12 = array[1..12] of char;
  46.    char13 = array[1..13] of char;
  47.    char14 = array[1..14] of char;
  48.    char15 = array[1..15] of char;
  49.    char16 = array[1..16] of char;
  50.    char19 = array[1..19] of char;
  51.    char24 = array[1..24] of char;
  52.    char25 = array[1..25] of char;
  53.    char30 = array[1..30] of char;
  54.    char32 = array[1..32] of char;
  55.    char45 = array[1..45] of char;
  56.    char128 = array[1..128] of char;
  57.  
  58.    {layout of the PCBOARD.SYS file while doors are open}
  59.   PCB_sys_rec   = Record             { 128 Bytes for PCBOARD version 14.0  }
  60.          Display  : char2;            { Sysop's Display ON/OFF              }
  61.          Printer  : char2;            { Sysop's Printer ON/OFF              }
  62.          PageBell : char2;            { Sysop's Page Bell ON/OFF            }
  63.          CallAlarm: char2;            { Caller Alarm ON/OFF                 }
  64.          ModemType: char2;            { Error Correcting Modem YES/NO       }
  65.          SysopNext: Char;             { Sysop "Next On" Flag                }
  66.          BaudRate : char5;            { "CONNECT" Baud Rate of Caller       }
  67.          Name     : char25;           { Full Name of Caller   (First & Last)}
  68.  
  69.          FirstName: char15;           { First Name of Caller                }
  70.          Graphics : Char;             { Graphics Mode of Caller             }
  71.          NodeChat : Char;             { Available for Node Chat YES/NO      }
  72.          BaudOpen : char5;            { Baud Rate to Open Modem at          }
  73.  
  74.          RecordNum: Integer;           { User's Database Record Number (MKI$)}
  75.  
  76.          Password : char12;           { Password of Caller                  }
  77.          TimeLogOn: Integer;           { Time User Logged On   (MKI$ minutes)}
  78.          TimeUsed : Integer;           { Time Used Today       (MKI$ minutes)}
  79.          LogOnStr : char5;            { Time User Logged On       (HH:MM:SS)}
  80.          TimeLimit: Integer;           { Daily Time Limit      (MKI$ minutes)}
  81.          ByteLmtDL: Integer;           { Daily Download Limit  (MKI$ K-bytes)}
  82.          ConfExit : Char;              { Conference (Area) User Exited From  }
  83.          ConfFlags: char5;            { Areas User Has "Joined" Today       }
  84.          ConfScan : char5;            { Areas User Has Scanned for New Mail }
  85.          ConfTime : Integer;           { Area "Bonus" Time     (MKI$ minutes)}
  86.          TimeCred : Integer;           { Upload Time Credit    (MKI$ minutes)}
  87.          Language : char4;            { Language Version Being Used         }
  88.          TimeLeft : Integer;           { Session Time Remaining(MKI$ minutes)}
  89.          NodeNum  : Char;              { BBS Node Number That Caller is Using}
  90.          EventTime: char5;            { Scheduled EVENT Time         (HH:MM)}
  91.          EventFlag: char2;            { Is EVENT Time Active?               }
  92.          EventMove: char2;            { Delay EVENT Until User Logs Off?    }
  93.          MsgRecall: char4;            { "Memorized" Message Number    (MKS$)}
  94.          ComPortID: Char;              { Com Port Number (0, 1, 2)           }
  95.          Reserved : char2;            { Reserved for Future Use             }
  96.        End;
  97.  
  98.  
  99.    {layout of the USERS.PCB file}
  100.    pcb_user_rec = record
  101.       name:          char25;
  102.       city:          char24;
  103.       passwd:        char12;      {no spaces allowed}
  104.       busphone:      char13;
  105.       phone:         char13;
  106.       date:          char8;        {mm-dd-yy of last call}
  107.       time:          char5;        {hh:mm    of last call}
  108.       xpert:         char;         {Y or N}
  109.       protocol:      char;         {X, C, Y, N}
  110.       conferences:   char9;        {10000000}
  111.       inconference:  char;
  112.       rejoin:        char;         {Y or N}
  113.       filedate:      char6;        {yymmdd of last file directory}
  114.       level:         integer;
  115.       total_calls:   integer;
  116.       pagelen:       integer;
  117.       lastread:      array[0..9] of integer;  {for main board & each conf.}
  118.       uploads:       integer;
  119.       downloads:     integer;
  120.       lastused:      integer;            {time used on previous call}
  121.       dead:          char;               {positive delete flag}
  122.    end;
  123.  
  124. var  deffile:file of pcb_sys_rec;
  125.      outrec:PCB_SYS_REC;
  126.      timer2,timeleft2,logontime2,numout:longint;
  127.      singleout:integer;
  128.      nameout:string[31];
  129.      tl1,tl2:string[2];
  130.      tempbaud:string[4];
  131.      tempt:string[5];
  132.      u:userrec;
  133.      longtemp:longint;
  134. Begin
  135.    assign (deffile,'pcboard.sys'); {info file}
  136.    rewrite(deffile);
  137.    outrec.display:='-1';                 {display on console?  -1 or 0}
  138.    outrec.printer:=' 0';                {print log?           -1 or 0}
  139.    outrec.pagebell:=' 0';               {bother sysop?        -1 or 0}
  140.    outrec.callalarm:=' 0';              {caller alarm sound?  -1 or 0}
  141.    outrec.sysopnext:=' ';                {force sysop on next? 'N ', 'X '
  142.                                            or '  '}
  143.    outrec.modemtype:=' 0';
  144.    if (ansigraphics in urec.config)
  145.          then outrec.graphics:='N'
  146.          else outrec.graphics :=' ';     {ansi graphics mode? '-1',' 0'or'7E'}
  147.       outrec.nodechat:='N';
  148.       if local then tempbaud:=' LOCA' else
  149.          str(baudrate:5,TempBaud);         {caller's baud rate}
  150.          Tempbaud := TempBaud + #0;
  151.      Move(tempbaud[1],outrec.baudopen[1],5);
  152.       outrec.baudrate:=outrec.baudopen;
  153.       outrec.recordnum:=1;
  154.       move(urec.handle[1],outrec.firstname,15);     {caller's name}
  155.       move(urec.password[1],outrec.password,12);
  156.                          {caller's password (last 2 chars redef'd}
  157.       outrec.timelogon:=logontime;
  158.       outrec.timeused:=usertime[ulvl]-urec.timetoday;      str(trunc(logontime DIV 60),tl1);
  159.       str((logontime MOD 60),tl2);
  160.       tempt:=tl1+':'+tl2;                    {time the user logged on in hh:mm}
  161.       move(tempt[1],outrec.logonstr[1],5);
  162.       outrec.timelimit:=usertime[ulvl];
  163.       outrec.bytelmtdl:=0;   {bytes of download limit}
  164.       FillChar(outrec.confexit,2,'0');
  165.       FillChar(outrec.confflags,5,'0');
  166.       FillChar(outrec.confscan,5,'0');
  167.       outrec.conftime:=0;
  168.       outrec.timecred:=0;
  169.       outrec.language:='    ';
  170.       move(urec.handle[1],outrec.name,25);        {caller's name}
  171.       outrec.timeleft:=urec.timetoday;
  172.       outrec.nodenum:='1';
  173.       outrec.eventtime:='00:00';
  174.       outrec.eventflag:='NO';
  175.       outrec.eventmove:='NO';
  176.       outrec.msgrecall:='0001';
  177.       outrec.comportid:='1';     {commport}
  178.       outrec.reserved:='  ';
  179.    write(deffile,outrec);
  180.    close(deffile);
  181.    end;
  182.  
  183.  
  184. Procedure dorinfo1;
  185. var        u:userrec;
  186.      deffile:text;
  187. Begin
  188.    assign (deffile,'dorinfo1.def'); {info file}
  189.    rewrite(deffile);
  190.    writeln(deffile,'The Forum Demo BBS');        {BBS name}
  191.    writeln(deffile,'Kevin');                   {sysop first name}
  192.    writeln(deffile,'Boyles');                          {sysop last name}
  193.    if local
  194.    then
  195.      writeln(deffile,'LOCAL')
  196.    else
  197.      writeln(deffile,'COM1');                      {COMM port}
  198.    writeln(deffile,baudrate,' BAUD,N,8,1');      {baudrate^BAUD,N,n,x}
  199.    writeln(deffile,'0');                         {network type }
  200.    writeln(deffile,unam);                        {user first name}
  201.    writeln(deffile,' ');                         {user last name}
  202.    writeln(deffile,' ');                         {user city,state}
  203.    if (ansigraphics in urec.config) then         {0 no graphics }
  204.     writeln(deffile,'2') else writeln(deffile,'0'); {1-ascii  2-ansi}
  205.    writeln(deffile,ulvl);                        {user level}
  206.    writeln(deffile,timeleft);                    {time remaining}
  207.    writeln(deffile,'0');                         {EOF must have}
  208. textclose(deffile);
  209. end;
  210.  
  211.  
  212.  
  213. procedure def_user;
  214. var     deffile:text;
  215.         temptime : integer;
  216. Begin
  217.    assign (deffile,'USERINFO.TXT'); {info file}
  218.    rewrite(deffile);
  219.    writeln(deffile,unam);                        {user first name}
  220.    writeln(deffile,baudrate);
  221. if parity then
  222.    writeln(deffile,'7')
  223.           else
  224.    writeln(deffile,'8');
  225. if timeleft > 60 then temptime := 60 else temptime := timeleft;
  226.    writeln(deffile,temptime*60);                 {time remaining}
  227.    writeln(deffile,'0');                         {EOF must have}
  228. textclose(deffile);
  229. end;
  230.  
  231. Procedure Definefiles;
  232. begin
  233.   def_pcbfile;
  234.   dorinfo1;
  235.   def_user;
  236. end;
  237.  
  238.  
  239. begin
  240. end.
  241.