Category : BBS Programs+Doors
Archive   : PCSIGDOR.ZIP
Filename : DODINDEX.PAS

 
Output of file : DODINDEX.PAS contained in archive : PCSIGDOR.ZIP
{$A+,B-,D+,E+,F-,I+,L+,N-,O-,R+,S+,V-}
{$M 6000,14000,14000}

(*
* DODINDEX.PAS
* Copyright 1989 by Michael A. Quinlan, all rights reserved.
* Written in Turbo Pascal v5.0.
* Uses the Turbo Professional library from TurboPower Software.
*
* Build an index of the PC-SIG Directory on Disk.
*
*)

program DODINDEX;

uses TPDOS;

var dodf : TEXT; { Diskette Descriptions }
idxf : file of longint; { Index File }
line : string[80]; { Current line in Diskette Descriptions }
lastdisk : integer; { Highest diskette indexed so far }
curdisk : integer; { Current diskette number }
curpos : longint; { Current position in the description file}
nullpos : longint; { Dummy variable }
code : integer; { CODE from VAL function }
buffer : array [1..4096] of char; { File I/O Buffer }

begin

WriteLn('DODINDEX - Build an index for the PC-SIG Directory on Disk');
WriteLn('Copyright 1989 by Michael A. Quinlan, all rights reserved.');
WriteLn;

if ParamCount <> 2 then begin
WriteLn('Usage: DODINDEX d:\path\1_1000.UPP d:\path\dodindex.dat');
halt(1);
end;

FileMode := 0;
assign(dodf, ParamStr(1));
SetTextBuf(dodf, buffer);
{$I-} reset(dodf); {$I+}
if (IOResult <> 0) then begin
WriteLn('Unable to open ', ParamStr(1));
Halt(1);
end;

FileMode := 1;
assign(idxf, ParamStr(2));
rewrite(idxf);

lastdisk := -1;

while not eof(dodf) do begin
curpos := TextPos(dodf);
ReadLn(dodf, line);
if line <> '' then begin
val(copy(line, 1, 4), curdisk, code);
if (code = 0) and (curdisk > lastdisk) then begin
WriteLn('Indexing DISK', copy(line, 1, 4), '...');
lastdisk := lastdisk + 1;
while lastdisk < curdisk do begin
nullpos := -1;
Write(idxf, nullpos);
lastdisk := lastdisk + 1;
end;
Write(idxf, curpos);
end;
end;
end;

close(dodf);
close(idxf);

WriteLn('Done.');

end.


  3 Responses to “Category : BBS Programs+Doors
Archive   : PCSIGDOR.ZIP
Filename : DODINDEX.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/