home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 276.img / FORUM21S.ZIP / CONFIG.SUP < prev    next >
Text File  |  1988-02-09  |  25KB  |  1,064 lines

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