Skip to content

Instantly share code, notes, and snippets.

@ssg
Created September 6, 2024 20:56
Show Gist options
  • Save ssg/af0990e71afc11215ab4fb62af392fa3 to your computer and use it in GitHub Desktop.
Save ssg/af0990e71afc11215ab4fb62af392fa3 to your computer and use it in GitHub Desktop.
Module lister for FatalVision and other GenSys source code
{ Module Lister 1.00 - (c) 1994 SSG }
uses Debris,Dos,Objects,XIO,XStream;
type
TModuleHeader = record
Name : string[20];
Coder : string[20];
Date : string[11];
Time : string[5];
end;
function Instr(src:string;var dst:string):boolean;
begin
Instr := pos(src,dst) = 1;
end;
procedure Describe(f:FNameStr);
var
T:TTextStream;
rec:TModuleHeader;
s:string;
s1:string;
function getparam:string;
var
b:byte;
begin
getparam := '';
b := pos(':',s);
if b > 0 then getparam := copy(s,b+2,255);
end;
begin
T.Init(f,stOpenRead);
T.Readln(s);
if s <> '{' then begin
T.Done;
exit;
end;
s := XGetFileName(f);
while length(s) < 12 do s := s + ' ';
write(s+':');
FillChar(rec,sizeof(rec),0);
while pos('}',s) = 0 do begin
T.Readln(s);
if pos('}',s) = 0 then begin
s1 := s;
UpperStr(s1);
if Instr('NAME',s1) then rec.name := getparam else
if Instr('CODER',s1) then rec.coder := getparam else
if Instr('DATE',s1) then rec.date := getparam else
if Instr('TIME',s1) then rec.time := getparam;
end;
end;
T.Done;
with rec do begin
while length(name) < 20 do name := name + ' ';
while length(coder) < 20 do coder := coder + ' ';
while length(date) < 11 do date := ' '+date;
while length(time) < 5 do time := ' '+time;
writeln(name+coder+' '+date+' '+time);
end;
end;
procedure ListDir(dir:FNameStr);
var
dirinfo:SearchRec;
begin
FindFirst(dir+'\*.pas',Archive,dirinfo);
while DosError = 0 do begin
Describe(dir+'\'+dirinfo.name);
FindNext(dirinfo);
end;
end;
begin
XAppInit('Module Lister','1.00','SSG',0,'');
writeln('FatalVision modules:');
writeln;
ListDir('\t6\xvision');
writeln;
writeln('GenDis modules:');
writeln;
ListDir('\t6\gendis');
writeln;
writeln('GenJin modules:');
writeln;
ListDir('\t6\genjin');
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment