home *** CD-ROM | disk | FTP | other *** search
-
-
- This is a copy of the readquick() and readpcb() functions which are
- incorporated directly into the TriDoor package. They are supplied to you
- as a reference for creating your own BBS support functions.
-
- For further information on creating door support functions, read the
- main TriDoor documentation included with this package.
-
- {* * * * * * * * *}
-
- function readquick : boolean;
-
- { reads a users stats from the file DORINFO1.DEF and returns
- false if there was an error. }
-
- var
- deffile : text;
- i,
- loop,
- loop2 : integer;
- comst,
- filler : string;
- work1,
- work2 : string[40];
-
- begin { readquick }
-
- if fsearch(mainpath+'DORINFO1.DEF','') <> '' then
- begin
- assign(deffile,mainpath+'DORINFO1.DEF');
- reset(deffile);
- for loop := 1 to 4 do
- readln(deffile,filler);
- case filler[4] of
- '0' : stats.comport := 0;
- '1' : stats.comport := COM1;
- '2' : stats.comport := COM2;
- '3' : stats.comport := COM3;
- '4' : stats.comport := COM4;
- end;
- readln(deffile,stats.comstr);
- readln(deffile,filler);
- readln(deffile,work1);
- readln(deffile,work2);
- readln(deffile,filler);
- readln(deffile,i);
- readln(deffile,filler);
- readln(deffile,stats.time);
- close(deffile);
-
- stats.name := work1 + ' ' + work2;
-
- work1 := '';
- loop2 := 0;
- loop := length(stats.comstr);
-
- while (loop2<loop) and (ord(stats.comstr[loop2+1]) <> 32) do
- begin
- loop2 := loop2 + 1;
- work1 := work1 + stats.comstr[loop2];
- end;
-
- val(work1,stats.real_baud,loop);
-
- if i = 1 then stats.ansi := TRUE
- else stats.ansi := FALSE;
-
- i := pos('BAUD',stats.comstr);
- i := i + 5;
-
- work1 := copy(stats.comstr,i,1);
- case work1[1] of
- 'N' : stats.comp_parity := NONE;
- 'E' : stats.comp_parity := EVEN;
- 'O' : stats.comp_parity := ODD;
- 'M' : stats.comp_parity := MARK;
- 'S' : stats.comp_parity := SPACE;
- end;
-
- val(copy(stats.comstr,i + 3,1),loop,loop2);
- stats.comp_dbits := loop;
- val(copy(stats.comstr,i + 5,1),loop,loop2);
- stats.comp_sbits := loop;
-
- readquick := true;
- end
- else
- readquick := false;
-
- end; { readquick }
-
- {* * * * * * * * *}
-
- function readpcb : boolean;
-
- { This function will get all crucial information from the PCBoard }
- { PCBOARD.SYS file, directed to by <mainpath>. }
-
- var
- deffile : file of pcbreaderrec;
- defrec : pcbreaderrec;
- err : integer;
- tempstr : string;
-
- begin { readpcb }
-
- if fsearch( mainpath+'PCBOARD.SYS', '' ) <> '' then
- begin
-
- assign( deffile, mainpath+'PCBOARD.SYS' );
- reset( deffile );
- read( deffile, defrec );
- close( deffile );
-
- if (pos(' ',defrec.name) > 0) then
- stats.name := copy(defrec.name,1,pos(' ',defrec.name)-1)
- else stats.name := defrec.name;
-
- tempstr := copy(defrec.baud,1,5);
-
- if (pos(' ',tempstr) > 0) then
- tempstr := copy( tempstr, 1, pos(' ',tempstr)-1);
-
- val(tempstr,stats.lock_baud,err);
-
- tempstr := copy(defrec.baud,6,5);
-
- if (pos(' ',tempstr) > 0) then
- tempstr := copy( tempstr, 1, pos(' ',tempstr)-1);
-
- if ucase(tempstr) = 'LOCAL' then
- begin
- stats.real_baud := 0;
- stats.lock_baud := 0;
- local := TRUE;
- end
- else val(tempstr,stats.real_baud,err);
-
- stats.time := defrec.time;
-
- case defrec.comport of
- '0' : stats.comport := 0;
- '1' : stats.comport := COM1;
- '2' : stats.comport := COM2;
- '3' : stats.comport := COM3;
- '4' : stats.comport := COM4;
- end;
-
- if (stats.lock_baud > 0) then
- stats.comstr := strg(stats.lock_baud)+',N,8,1'
- else stats.comstr := strg(stats.real_baud)+'N,8,1';
-
- if (defrec.ansi = 1) then stats.ansi := TRUE
- else stats.ansi := FALSE;
-
- stats.comp_parity := NONE;
- stats.comp_sbits := 1;
- stats.comp_dbits := 8;
-
- readpcb := true;
- end
- else
- readpcb := false;
-
- end; { readpcb }
-
- {* * * * * * * * *}