home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / SYSPC22.ZIP / CONFIG.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-05-02  |  22.8 KB  |  1,050 lines

  1. {$I-}{$V-}{$R-}{$U-}{$C-}
  2.  
  3. {$IGenTypes.Pas}
  4. {$IConfigRt.Pas}
  5.  
  6.  
  7. procedure writeconfig;
  8. var q:file of configsettype;
  9. begin
  10.   assign (q,'Config.BBS');
  11.   rewrite (q);
  12.   write (q,configset);
  13.   close (q)
  14. end;
  15.  
  16. procedure formatconfig;
  17. begin
  18.   longname[0]:=chr(0);
  19.   shortname[0]:=chr(0);
  20.   sysopname[0]:=chr(0);
  21.   supportedrates:=[b1200];
  22.   downloadrates:=supportedrates;
  23.   defbaudrate:=1200;
  24.   usecom:=1;
  25.   sysoplevel:=10;
  26.   textdir[0]:=chr(0);
  27.   uploaddir[0]:=chr(0);
  28.   boarddir[0]:=chr(0);
  29.   overlaypath[0]:=chr(0);
  30.   modemsetupstr[0]:=chr(0);
  31.   modemhangupstr[0]:=chr(0);
  32.   private:=false;
  33.   autologin:=false;
  34.   matfeed:=false;
  35.   fixhan:=false;
  36.   anonymouslevel:=5;
  37.   numwelcomes:=1;
  38.   normbotcolor:=6;
  39.   normtopcolor:=2;
  40.   outlockcolor:=5;
  41.   splitcolor:=4;
  42.   statlinecolor:=3;
  43.   mintimeout:=4;
  44.   dotchar:='.';
  45.   asciidownload[0]:=chr(0);
  46.   defudlevel:=0;
  47.   defudpoints:=0;
  48.   availtime[0]:=chr(0);
  49.   unavailtime[0]:=chr(0);
  50.   defgflevel:=0;
  51.   udlevel2nd:=0;
  52.   udpoints2nd:=0;
  53.   level2nd:=2;
  54.   postlevel:=2;
  55.   allowdoors:=true;
  56.   remotedoors:=false;
  57.   vote:=false;
  58.   gambling:=false;
  59.   ansiwait:=true;
  60.   udratio:=0;
  61.   gfudratio:=0;
  62.   writeconfig
  63. end;
  64.  
  65. type ttypetype=(TInteger,Tsstr,Tmstr,Tlstr,TBoolean,TChar,TBaudset,
  66.                 TPath,TTime,TAttrib,Tusertime,Badtype);
  67.      ptrset=record
  68.        case integer of
  69.          0:(i:^integer);
  70.          1:(l:^lstr);
  71.          2:(b:^boolean);
  72.          3:(k:^char);
  73.          4:(baudsetptr:^baudset)
  74.      end;
  75.      thing=record
  76.        text:mstr;
  77.        descrip:lstr;
  78.        ttype:ttypetype;
  79.        p:ptr;
  80.        r1,r2:integer
  81.      end;
  82.  
  83. const ttypestr:array [ttypetype] of sstr=
  84.   ('Int','sstr','mstr','lstr','Boo','Char','Baud','Path','Time',
  85.    'Attrib','Usertime','!!!!????');
  86.       colorstr:array [0..15] of mstr=
  87.   ('Black','Blue ','Green ','Cyan ','Red ','Magenta ','Brown ','White ',
  88.    'Gray ','BLUE!','GREEN!','CYAN!','RED!','MAGENTA!','Yellow','WHITE!');
  89.  
  90. const maxthings=100;
  91.       dcol=30;
  92.  
  93. var top,bot,page,numpages,numthings:integer;
  94.     things:array [1..maxthings] of thing;
  95.  
  96. procedure c2;
  97. begin
  98.   textcolor (2)
  99. end;
  100.  
  101. procedure c3;
  102. begin
  103.   textcolor (3)
  104. end;
  105.  
  106. procedure c4;
  107. begin
  108.   textcolor (4)
  109. end;
  110.  
  111. procedure c6;
  112. begin
  113.   textcolor (6)
  114. end;
  115.  
  116. procedure c7;
  117. begin
  118.   textcolor (7)
  119. end;
  120.  
  121. function match(a1,a2:anystr):boolean;
  122. var cnt:integer;
  123. begin
  124.   match:=false;
  125.   while a1[length(a1)]=' ' do a1[0]:=pred(a1[0]);
  126.   while a2[length(a2)]=' ' do a2[0]:=pred(a2[0]);
  127.   if length(a1)<>length(a2) then exit;
  128.   for cnt:=1 to length(a1) do
  129.     if upcase(a1[cnt])<>upcase(a2[cnt]) then exit;
  130.   match:=true
  131. end;
  132.  
  133. function yesnostr (var b:boolean):sstr;
  134. begin
  135.   if b and (ord(b)<>ord(true)) then b:=true;
  136.   if b then yesnostr:='Yes' else yesnostr:='No'
  137. end;
  138.  
  139. function strr (n:integer):mstr;
  140. var q:mstr;
  141. begin
  142.   str (n,q);
  143.   strr:=q
  144. end;
  145.  
  146. function valu (q:mstr):integer;
  147. var i,s:integer;
  148. begin
  149.   val (q,i,s);
  150.   if s=1
  151.     then valu:=0
  152.     else valu:=i
  153. end;
  154.  
  155. procedure setptr (var p:ptr; var n);
  156. begin
  157.   p:=ptr(seg(n),ofs(n))
  158. end;
  159.  
  160. function whichpage (n:integer):integer;
  161. begin
  162.   whichpage:=((n-1) div 20)+1
  163. end;
  164.  
  165. function whichline (n:integer):integer;
  166. begin
  167.   whichline:=n-20*(whichpage(n)-1)+2
  168. end;
  169.  
  170. function getbaudstr (var q:baudset):lstr;
  171. var w:lstr;
  172.     cnt:baudratetype;
  173. begin
  174.   w[0]:=chr(0);
  175.   for cnt:=firstbaud to lastbaud do
  176.     if cnt in q then w:=w+strr(baudarray[cnt])+' ';
  177.   if length(w)=0 then w:='None';
  178.   getbaudstr:=w
  179. end;
  180.  
  181. procedure writevar (n:integer);
  182. var pu:ptr;
  183.     p:ptrset absolute pu;
  184. begin
  185.   c2;
  186.   pu:=things[n].p;
  187.   case things[n].ttype of
  188.     tinteger:write (p.i^);
  189.     tlstr,tmstr,tsstr,tpath,ttime:write (p.l^);
  190.     tboolean:write (yesnostr(p.b^));
  191.     tchar:write (p.k^);
  192.     tbaudset:write (getbaudstr (p.baudsetptr^));
  193.     tattrib:write (colorstr[p.i^]);
  194.     tusertime:write ('(Choose this choice to configure user daily time)')
  195.   end;
  196.   c6; clreol;
  197.   writeln
  198. end;
  199.  
  200. procedure showpage;
  201. var cnt:integer;
  202. begin
  203.   c6; clrscr;
  204.   write ('Page ');
  205.   c2; write (page);
  206.   c6; write (' of ');
  207.   c2; write (numpages);
  208.   c6; writeln (':');
  209.   writeln;
  210.   top:=(page-1)*20+1;
  211.   bot:=top+19;
  212.   if bot>numthings then bot:=numthings;
  213.   for cnt:=top to bot do begin
  214.     gotoxy (1,cnt-top+3);
  215.     write (cnt:2,'. ',things[cnt].text,': ');
  216.     gotoxy (dcol,wherey);
  217.     writevar (cnt)
  218.   end
  219. end;
  220.  
  221. procedure gotopage (p:integer);
  222. begin
  223.   if p<1 then p:=1;
  224.   if p>numpages then p:=numpages;
  225.   if p=page then exit;
  226.   page:=p;
  227.   showpage
  228. end;
  229.  
  230. procedure readdata;
  231. var q:text;
  232.     t:mstr;
  233.  
  234.   procedure dataerror (n:lstr);
  235.   begin
  236.     writeln ('Record ',numthings,': '+n);
  237.     halt
  238.   end;
  239.  
  240.   procedure illtype;
  241.   begin
  242.     dataerror ('Invalid type: '+t)
  243.   end;
  244.  
  245.   procedure getrange (t:mstr; var r1,r2:integer);
  246.   var sp,da,n1,n2:integer;
  247.   begin
  248.     sp:=pos(' ',t);
  249.     r1:=-32767;
  250.     r2:=32767;
  251.     if sp=0 then exit;
  252.     t:=copy(t,sp+1,255);
  253.     if length(t)<1 then exit;
  254.     da:=pos('-',t);
  255.     if (da=1) and (length(t)=1) then exit;
  256.     if da=0 then begin
  257.       r1:=valu(t);
  258.       r2:=r1;
  259.       exit
  260.     end;
  261.     n1:=valu(copy(t,1,da-1));
  262.     n2:=valu(copy(t,da+1,255));
  263.     if da=1 then begin
  264.       r2:=n2;
  265.       exit
  266.     end;
  267.     r1:=n1;
  268.     if da=length(t) then exit;
  269.     r2:=n2
  270.   end;
  271.  
  272.   procedure gettype (t:mstr; var tt:ttypetype);
  273.   var sp:integer;
  274.       fw:mstr;
  275.   begin
  276.     tt:=ttypetype(0);
  277.     sp:=pos(' ',t);
  278.     if sp=0
  279.       then fw:=t
  280.       else fw:=copy(t,1,sp-1);
  281.     while tt<>badtype do
  282.       begin
  283.         if match(fw,ttypestr[tt]) then exit;
  284.         tt:=succ(tt)
  285.       end;
  286.     tt:=badtype;
  287.     illtype
  288.   end;
  289.  
  290. begin
  291.   assign (q,'Config.Dat');
  292.   reset (q);
  293.   numthings:=0;
  294.   if ioresult<>0 then dataerror ('File CONFIG.DAT not found!');
  295.   while not eof(q) do begin
  296.     numthings:=numthings+1;
  297.     with things[numthings] do begin
  298.       readln (q,text);
  299.       readln (q,descrip);
  300.       readln (q,t);
  301.       gettype (t,ttype);
  302.       if ttype=tinteger then getrange (t,r1,r2)
  303.     end
  304.   end;
  305.   close (q)
  306. end;
  307.  
  308. procedure assignptrs;
  309. var cnt:integer;
  310.  
  311.   procedure s (var q);
  312.   begin
  313.     setptr (things[cnt].p,q);
  314.     cnt:=cnt+1
  315.   end;
  316.  
  317. begin
  318.   cnt:=1;
  319.   s (longname);
  320.   s (shortname);
  321.   s (sysopname);
  322.   s (autologin);
  323.   s (textdir);
  324.   s (boarddir);
  325.   s (uploaddir);
  326.   s (textfiledir);
  327.   s (overlaypath);
  328.   s (supportedrates);
  329.   s (downloadrates);
  330.   s (defbaudrate);
  331.   s (usecom);
  332.   s (modemsetupstr);
  333.   s (modemhangupstr);
  334.   s (resetmodem);
  335.   s (offhookmodem);
  336.   s (answermodem);
  337.   s (sysoplevel);
  338.   s (anonymouslevel);
  339.   s (numwelcomes);
  340.   s (private);
  341.   s (ansiwait);
  342.   s (useconmode);
  343.   s (escinmsgs);
  344.   s (bkspinmsgs);
  345.   s (normbotcolor);
  346.   s (normtopcolor);
  347.   s (outlockcolor);
  348.   s (splitcolor);
  349.   s (statlinecolor);
  350.   s (usertime);
  351.   s (mintimeout);
  352.   s (dotchar);
  353.   s (asciidownload);
  354.   s (fixhan);
  355.   s (defgflevel);
  356.   s (defudlevel);
  357.   s (defudpoints);
  358.   s (level2nd);
  359.   s (udlevel2nd);
  360.   s (udpoints2nd);
  361.   s (vote);
  362.   s (forvote);
  363.   s (xferratio);
  364.   s (gfratio);
  365.   s (gfudratio);
  366.   s (udratio);
  367.   s (nopcr);
  368.   s (postlevel);
  369.   s (uploadfactor);
  370.   s (availtime);
  371.   s (unavailtime);
  372.   s (xmodemopentime);
  373.   s (xmodemclosetime);
  374.   s (unix);
  375.   s (unixdefault);
  376.   s (matrix);
  377.   s (syspwrd1);
  378.   s (syspwrd2);
  379.   s (syspwrd3);
  380.   s (matfeed);
  381.   s (anonymousstr);
  382.   s (requireforms);
  383.   s (remotedoors);
  384.   s (allowdoors);
  385.   s (gambling);
  386.   s (unarc);
  387.   s (arcview);
  388.   if cnt<>numthings+1 then begin
  389.     writeln ('Error in number of items of CONFIG.DAT');
  390.     halt
  391.   end
  392. end;
  393.  
  394. procedure byebye;
  395. begin
  396.   clrscr;
  397.   gotoxy (38,24);
  398.   c3; writeln ('Bye!');
  399.   halt
  400. end;
  401.  
  402. procedure abortyn;
  403. var q:sstr;
  404. begin
  405.   gotoxy (1,24);
  406.   c4;
  407.   write ('Confirm abort [Y/N]: ');
  408.   c6;
  409.   clreol;
  410.   buflen:=1;
  411.   c3; readln (q); c6;
  412.   if length(q)>0 then if upcase(q[1])='Y' then byebye
  413. end;
  414.  
  415. procedure getinput (n:integer);
  416. var y:integer;
  417.     inp:lstr;
  418.     t:thing;
  419.     pu:ptr;
  420.     p:ptrset absolute pu;
  421.  
  422.   procedure reshow;
  423.   begin
  424.     gotoxy (dcol,y);
  425.     writevar (n)
  426.   end;
  427.  
  428.   procedure showintrange;
  429.   begin
  430.     c7;
  431.     with t do
  432.       if r1=-32767
  433.         then if r2=32767
  434.           then write ('No range limitation.')
  435.           else write ('Maximum value: ',r2)
  436.         else if r2=32767
  437.           then write ('Minimum value: ',r1)
  438.           else write ('Valid values range from ',r1,' to ',r2);
  439.     c6
  440.   end;
  441.  
  442.   procedure doint;
  443.   var n,s:integer;
  444.       k:char;
  445.   begin
  446.     val (inp,n,s);
  447.     gotoxy (1,24);
  448.     if s<>0
  449.       then
  450.         begin
  451.           c4;
  452.           writeln ('Invalid number!  A number must be from -32767 to 32767.');
  453.           c6;
  454.           write ('Press any key...');
  455.           clreol;
  456.           read (kbd,k)
  457.         end
  458.       else if (n>=t.r1) and (n<=t.r2)
  459.         then p.i^:=n
  460.         else
  461.           begin
  462.             c4;
  463.             writeln ('Range error!  Must be within the above limits!  ');
  464.             c6;
  465.             write ('Press any key...');
  466.             clreol;
  467.             read (kbd,k)
  468.           end
  469.   end;
  470.  
  471.   procedure dostr;
  472.   begin
  473.     if (inp='N') or (inp='n') then inp:='';
  474.     p.l^:=inp
  475.   end;
  476.  
  477.   procedure doboolean;
  478.   begin
  479.     case upcase(inp[1]) of
  480.       'Y':p.b^:=true;
  481.       'N':p.b^:=false
  482.     end
  483.   end;
  484.  
  485.   procedure dochar;
  486.   begin
  487.     p.k^:=inp[1]
  488.   end;
  489.  
  490.   procedure dopath;
  491.   var lc:char;
  492.       cur:lstr;
  493.       r:regs;
  494.       n:integer;
  495.   begin
  496.     lc:=inp[length(inp)];
  497.     if (length(inp)<>1) or (upcase(lc)<>'N')
  498.       then if (lc<>':') and (lc<>'\') then inp:=inp+'\';
  499.     dostr;
  500.     if inp[length(inp)]='\' then inp[0]:=pred(inp[0]);
  501.     r.ah:=$19;
  502.     intr ($21,r);
  503.     getdir (r.al+1,cur);
  504.     chdir (inp);
  505.     n:=ioresult;
  506.     chdir (cur);
  507.     if n=0 then exit;
  508.     c4; gotoxy (1,24);
  509.     write ('Path doesn''t exist!  ');
  510.     c6; write ('Create it now? '); clreol;
  511.     c3; readln (cur);
  512.     if length(cur)=0 then exit;
  513.     if upcase(cur[1])<>'Y' then exit;
  514.     mkdir (inp);
  515.     if ioresult=0 then exit;
  516.     gotoxy (1,24);
  517.     c4; write ('Error creating directory!  ');
  518.     c6; write ('Press any key...');
  519.     clreol;
  520.     read (kbd,lc)
  521.   end;
  522.  
  523.   procedure dotime;
  524.   var c,s,l:integer;
  525.       d1,d2,d3,d4:char;
  526.       ap,m:char;
  527.  
  528.     function digit (k:char):boolean;
  529.     begin
  530.       digit:=ord(k) in [48..57]
  531.     end;
  532.  
  533.   begin
  534.     l:=length(inp);
  535.     if l=1 then begin
  536.       if upcase(inp[1])='N' then dostr;
  537.       exit
  538.     end;
  539.     if (l<7) or (l>8) then exit;
  540.     c:=pos(':',inp);
  541.     if c<>l-5 then exit;
  542.     s:=pos(' ',inp);
  543.     if s<>l-2 then exit;
  544.     d2:=inp[c-1];
  545.     if l=7
  546.       then d1:='0'
  547.       else d1:=inp[1];
  548.     d3:=inp[c+1];
  549.     d4:=inp[c+2];
  550.     ap:=upcase(inp[s+1]);
  551.     m:=upcase(inp[s+2]);
  552.     if d1='1' then if d2>'2' then d2:='!';
  553.     if (d1>='0') and (d1<='1') and digit(d2) and (d3>='0') and (d3<='5')
  554.        and digit(d4) and ((ap='A') or (ap='P')) and (m='M') then dostr
  555.   end;
  556.  
  557.   procedure dobaud;
  558.   var inp:lstr;
  559.       n:integer;
  560.       cnt:baudratetype;
  561.   label bfound,again;
  562.   begin
  563.     gotoxy (1,24);
  564.     repeat
  565.       gotoxy (wherex,24);
  566.       write ('Baud rate to toggle [CR to quit]: ');
  567.       clreol;
  568.       buflen:=4;
  569.       c3; readln (inp); c6;
  570.       gotoxy (1,24);
  571.       if length(inp)=0 then exit;
  572.       n:=valu(inp);
  573.       for cnt:=b110 to b9600 do if n=baudarray[cnt] then goto bfound;
  574.       c2; write ('Not supported!  '); c6;
  575.       goto again;
  576.       bfound:
  577.       if cnt in p.baudsetptr^
  578.         then p.baudsetptr^:=p.baudsetptr^-[cnt]
  579.         else p.baudsetptr^:=p.baudsetptr^+[cnt];
  580.       reshow;
  581.       again:
  582.     until 0=1
  583.   end;
  584.  
  585.   procedure dousertime;
  586.   var input:lstr;
  587.       n:integer;
  588.  
  589.     procedure refresh;
  590.     var cnt:integer;
  591.     begin
  592.       c6; clrscr;
  593.       writeln('Level Time | Level Time | Level Time | Level Time | Level Time');
  594.       writeln('-----------|------------|------------|------------|-----------');
  595.       gotoxy (1,3);
  596.       for cnt:=1 to 100 do begin
  597.         write (cnt:4,': ',usertime[cnt]:4);
  598.         if (cnt mod 5)=0 then writeln else write (' | ')
  599.       end
  600.     end;
  601.  
  602.     procedure setone (n,v:integer);
  603.     var x,y:integer;
  604.     begin
  605.       x:=((n-1) mod 5)*13+7;
  606.       y:=((n-1) div 5)+3;
  607.       gotoxy (x,y);
  608.       write (v:4);
  609.       usertime[n]:=v
  610.     end;
  611.  
  612.     procedure getone (n:integer);
  613.     var x,y,v:integer;
  614.     begin
  615.       x:=((n-1) mod 5)*13+7;
  616.       y:=((n-1) div 5)+3;
  617.       gotoxy (x,y);
  618.       write ('    ');
  619.       gotoxy (x,y);
  620.       buflen:=4;
  621.       c3; readln (input); c6;
  622.       v:=valu(input);
  623.       if (v<1) or (v>1000) then v:=usertime[n];
  624.       setone (n,v)
  625.     end;
  626.  
  627.     function getn (txt:lstr):integer;
  628.     var input:lstr;
  629.     begin
  630.       gotoxy (1,24);
  631.       write (txt,': ');
  632.       clreol;
  633.       buflen:=4;
  634.       c3; readln (input); c6;
  635.       getn:=valu(input)
  636.     end;
  637.  
  638.     function getlvl (txt:lstr):integer;
  639.     var n:integer;
  640.     begin
  641.       n:=getn (txt);
  642.       if (n<1) or (n>100) then n:=0;
  643.       getlvl:=n
  644.     end;
  645.  
  646.     procedure pattern;
  647.     var st,en,ba,se,cn:integer;
  648.     begin
  649.       st:=getlvl ('Starting level of pattern');
  650.       if st=0 then exit;
  651.       en:=getlvl ('Ending level of pattern');
  652.       if en<st then exit;
  653.       ba:=getn ('Time for level '+strr(st));
  654.       if (ba<1) or (ba>1000) then exit;
  655.       se:=getn ('Additional time per level');
  656.       if (se<0) or (se>1000) then exit;
  657.       cn:=st;
  658.       repeat
  659.         setone (cn,ba);
  660.         if ba+se<1000
  661.           then ba:=ba+se
  662.           else ba:=1000;
  663.         cn:=cn+1
  664.       until cn>en
  665.     end;
  666.  
  667.   var k:char;
  668.   begin
  669.     refresh;
  670.     repeat
  671.       repeat
  672.         gotoxy (1,24);
  673.         write ('Number to change, [P] for a pattern, or [Q] to quit: ');
  674.         clreol;
  675.         c3; readln (input); c6
  676.       until length(input)>0;
  677.       k:=upcase(input[1]);
  678.       n:=valu(input);
  679.       if (n>=1) and (n<=100) then getone(n) else
  680.         case k of
  681.           'P':pattern
  682.         end
  683.     until k='Q';
  684.     showpage
  685.   end;
  686.  
  687.   procedure showattribhelp;
  688.   var cnt:integer;
  689.  
  690.     procedure demo;
  691.     begin
  692.       textcolor (cnt);
  693.       write (cnt:2,')',colorstr[cnt],' ')
  694.     end;
  695.  
  696.   begin
  697.     gotoxy (1,23);
  698.     for cnt:=0 to 7 do demo;
  699.     gotoxy (1,24);
  700.     for cnt:=8 to 15 do demo;
  701.     c6
  702.   end;
  703.  
  704.   procedure doattrib;
  705.   var cnt,v:integer;
  706.       k:char;
  707.   begin
  708.     v:=valu(inp);
  709.     if ((v=0) and (inp[1]<>'0')) or (v<0) or (v>15) then begin
  710.       v:=-1;
  711.       for cnt:=0 to 15 do if match (inp,colorstr[cnt]) then v:=cnt;
  712.       if v=-1 then exit
  713.     end;
  714.     p.i^:=v
  715.   end;
  716.  
  717. begin
  718.   t:=things[n];
  719.   pu:=t.p;
  720.   gotopage (whichpage(n));
  721.   y:=whichline(n);
  722.   if not (t.ttype in [tbaudset,tusertime]) then begin
  723.     gotoxy (1,23);
  724.     clreol;
  725.     writeln;
  726.     clreol;
  727.     writeln;
  728.     write (t.descrip);
  729.     clreol;
  730.     gotoxy (1,24);
  731.     case t.ttype of
  732.       tinteger:
  733.         begin
  734.           buflen:=6;
  735.           showintrange
  736.         end;
  737.       tsstr,ttime:buflen:=15;
  738.       tmstr:buflen:=30;
  739.       tlstr,tpath:buflen:=80;
  740.       tboolean,tchar:buflen:=1;
  741.       tattrib:showattribhelp
  742.     end;
  743.     if buflen+dcol>79 then buflen:=79-dcol;
  744.     gotoxy (dcol,y);
  745.     clreol;
  746.     c3; readln (inp); c6
  747.   end else inp[0]:=^A;
  748.   if length(inp)<>0 then
  749.     case t.ttype of
  750.       tinteger:doint;
  751.       tsstr,tmstr,tlstr:dostr;
  752.       tboolean:doboolean;
  753.       tchar:dochar;
  754.       tbaudset:dobaud;
  755.       tpath:dopath;
  756.       ttime:dotime;
  757.       tattrib:doattrib;
  758.       tusertime:dousertime
  759.     end;
  760.   reshow;
  761.   gotoxy (1,23);
  762.   clreol;
  763.   writeln;
  764.   clreol;
  765.   writeln;
  766.   clreol;
  767.   t.p:=pu;
  768.   things[n]:=t
  769. end;
  770.  
  771. procedure changenum (ns:sstr);
  772. var n,s:integer;
  773. begin
  774.   val (ns,n,s);
  775.   if s<>0 then exit;
  776.   if (n<1) or (n>numthings) then exit;
  777.   getinput (n)
  778. end;
  779.  
  780. procedure maybemakeconfig;
  781. var f:file of configsettype;
  782. begin
  783.   assign (f,'Config.bbs');
  784.   reset (f);
  785.   if ioresult=0 then begin
  786.     close (f);
  787.     exit
  788.   end;
  789.   rewrite (f);
  790.   fillchar (configset,sizeof(configset),0);
  791.   write (f,configset);
  792.   close (f)
  793. end;
  794.  
  795. var command:sstr;
  796.     i:integer;
  797. begin
  798.   textmode (BW80);
  799.   textcolor (6);
  800.   writeln ('One moment...');
  801.   readdata;
  802.   assignptrs;
  803.   maybemakeconfig;
  804.   readconfig;
  805.   i:=ioresult;
  806.   numpages:=whichpage(numthings);
  807.   page:=0;
  808.   gotopage (1);
  809.   repeat
  810.     gotoxy (1,24);
  811.     write ('Number, N)ext, P)revious, S)ave, or A)bort, no save: ');
  812.     clreol;
  813.     buflen:=4;
  814.     c3; readln (command); c6;
  815.     if length(command)<>0 then
  816.       case upcase(command[1]) of
  817.         'N':gotopage (page+1);
  818.         'P':gotopage (page-1);
  819.         'S':begin
  820.               writeconfig;
  821.               byebye
  822.             end;
  823.         'A':abortyn;
  824.         else changenum (command)
  825.       end
  826.   until 0=1
  827. end.
  828.  
  829. (* Types are:
  830.      Int #-#           Integer in the range specified
  831.      Lstr              80 char string
  832.      Mstr              30 char string
  833.      Sstr              15 char string
  834.      Char              Single character
  835.      Boo               Boolean (y/n)
  836.      Path              Directory path
  837.      Baud              Set of baud rates
  838.      Time              Time of day
  839.      Attrib            Attribute, Black, Blue, etc.
  840.      Usertime          Special usertime per day type, doesn't print
  841. *)
  842.  
  843. Board name, Long
  844. Enter the name of your bulletin board
  845. lstr
  846. Board name, Short
  847. Enter a shortened form of the above
  848. lstr
  849. Sysop name
  850. Enter your name here.
  851. lstr
  852. Sysop auto-login
  853. If yes, signing on local will automatically log in under the sysop's name
  854. Boo
  855. Path to message base
  856. The message base files are held in this sub-directory.  Make sure it exists!
  857. path
  858. Path to board files
  859. Databases and sub-board files will use this path.
  860. path
  861. Path to ASCII uploads
  862. All ASCII uploads (to sub-boards) will be created in this sub-directory.
  863. path
  864. Path to text files
  865. This directory includes the menus, raise request, info-form, help, etc.
  866. path
  867. Path to overlay file (N)
  868. The overlay files will be copied here.  Enter a path, or N for none.
  869. path
  870. Supported BAUD rates
  871.  
  872. baud
  873. Download BAUD rates
  874.  
  875. baud
  876. Default BAUD rate
  877. Enter the start-up baud rate (for modem setup).
  878. Int 110-9600
  879. COM# port
  880. Enter the COM: port to which your modem is connected.  Standard value is 1.
  881. Int 1-2
  882. Modem setup text
  883. Text sent to the modem between callers.  |=CR, ~=pause, ^x=control-char
  884. lstr
  885. Modem hangup text
  886. Text to hang up modem. DTR=Hang up using DTR, |=CR, ~=pause, ^x=control-char
  887. lstr
  888. Modem reset text
  889. Text sent to the modem to make it reset. |=CR, ~=pause, ^x=control-char
  890. lstr
  891. Modem offhook text
  892. Text sent to the modem to take it offhook. |=CR, '=pause, ^x=control-char
  893. lstr
  894. Modem answer text
  895. Text sent to modem to force carrier. |=CR, '=pause, ^x=control-char
  896. lstr
  897. CO-SYSOP level
  898. Choose the security level for co-sysop.
  899. Int 1-32767
  900. Anonymous level
  901. Enter the level required to post anonymously.
  902. Int 1-32767
  903. # of welcome files
  904. Enter the number of welcome files you have.  Files named WELCOME.1, WELCOME.2
  905. Int 1-999
  906. Is the system private
  907. Enter Y or N.  If Yes, new users will not be allowed.
  908. boo
  909. Ansi WaitCall Screen
  910. Enter Y or N.  If Yes, colors will be shown on waitcall screen.
  911. boo
  912. Output to DOS CON:
  913. If Yes, then ANSI.SYS will work, but the colors may not.  Usually No.
  914. boo
  915. Escape in messages
  916. If Yes, users may place "escape codes" (ANSI control) in messages. Usually No.
  917. boo
  918. Backspacing in msgs
  919. If Yes, users may press ^Q in their messages to produce an overprint effect.
  920. boo
  921. Normal color
  922. Enter the standard text color attribute.  Commonly 2 (green) or 7 (white)
  923. Attrib
  924. Top split color
  925. Enter the attribute for the top screen half.  Commonly 2 (green) or 7 (white)
  926. Attrib
  927. Output-lock color
  928. Attribute to use when in snoop mode.  Commonly 5 (purple) or 7 (white)
  929. Attrib
  930. Split-line color
  931. Attribute to use for the line between the halves.  Commonly 7 (white)
  932. Attrib
  933. Status line color
  934. Attribute to use for the bottom line.  It will be in inverse mode.  7=white
  935. Attrib
  936. User time per day
  937.  
  938. Usertime
  939. Input time out
  940. Number of minutes of silence from remote user until the system hangs up.
  941. Int 2-60
  942. Hidden-input character
  943. Character to echo when user is entering his password.  Commonly ".".
  944. char
  945. End of download text
  946. Text to send at the end of an ASCII download.  Commonly holds this BBS's name.
  947. lstr
  948. Fix Name
  949. Fix the Users Name so that the first letter is capitalized.
  950. boo
  951. Newuser Gfile Level
  952. GFile Level for newusers
  953. int 0-32767
  954. Newuser file xfer lvl
  955. File transfer level for new users
  956. Int 0-32767
  957. Newuser file xfer pts
  958. File transfer points for new users, 0 if downloads are free on your system
  959. Int 0-32767
  960. 2nd call access level
  961. Access level to be automatically assigned on all users' second calls
  962. Int 0-32767
  963. 2nd call xfer level
  964. File transfer level to be assigned on all users' second calls
  965. Int 0-32767
  966. 2nd call xfer points
  967. File transfer points to be assigned on all users' second calls
  968. Int 0-32767
  969. Newuser vote
  970. Certain users can vote on a new user.
  971. boo
  972. Vote Level
  973. Level for above
  974. int 0-32767
  975. Xfer Post/Call ratio
  976. The percent of posts/call to access transfer sect.
  977. Int 0-500
  978. Gfile Post/Call Ratio
  979. See Above
  980. int 0-500
  981. Gfile U/D Ratio
  982. Upload/download ratio for G-Files
  983. int 0-500
  984. Xfer U/D Ratio
  985. Upload/download ratio for Xfer Section
  986. int 0-500
  987. Exempt level
  988. Level to be exempt from Post/call & U/D ratios
  989. int 0-32767
  990. Bulletin post level
  991. Level required to post a bulletin
  992. Int 0-32767
  993. Upload factor
  994. When you rate a file, the uploader will get (this number * your rating) points
  995. Int
  996. Time sysop's available
  997. Enter time sysop becomes available for chat.  Form: 8:30 am, 10:00 pm, etc.
  998. Time
  999. Time sysop isn't
  1000. Enter time sysop becomes unavailable for chat.  Form: 11:30 pm, 1:45 am, etc.
  1001. Time
  1002. Time file xfer opens
  1003. Enter time the file transfer section opens.  Form: 9:28 am, 12:15 pm, etc.
  1004. Time
  1005. Time file xfer closes
  1006. Enter time the file transfer section closes.  Form: 7:36 pm, 11:32 am, etc.
  1007. Time
  1008. Use Unix Login
  1009. Have a unix type login
  1010. boo
  1011. Unix Logon Password
  1012. The logon for the unix front
  1013. mstr
  1014. Use matrix login
  1015. Use matrix for up to 3 systems
  1016. boo
  1017. System 1 password
  1018. This password will be required before any user may log in.  Enter N for none.
  1019. mstr
  1020. System 2 password
  1021. Password to exit into system 2
  1022. mstr
  1023. System 3 password
  1024. Password to exit into system 3
  1025. mstr
  1026. Allow Matrix Feedback
  1027. Allow users to send feedback from matrix
  1028. boo
  1029. Anonymous string
  1030. The other users will see this replacing the name of an anonymous poster.
  1031. mstr
  1032. Require info-forms
  1033. If yes, then all users without info-forms will be required to enter them.
  1034. boo
  1035. Remote door maintenance
  1036. If yes, remote co-sysops will be able to create potentially dangerous doors.
  1037. boo
  1038. Allow doors at all
  1039. If yes, doors will be allowed. If not, all doors will be locked. For security.
  1040. boo
  1041. Allow Gambling
  1042. If yes, gambling sub-program will be activated
  1043. boo
  1044. Un-Arc String
  1045. String to unarc files. (I.E. Pkxarc)
  1046. mstr
  1047. Arc View String
  1048. String for ARC-View. (I.E. PKarc v)
  1049. mstr
  1050.