home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
bbs
/
prpics10.arc
/
PRPICS10.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1991-08-11
|
4KB
|
153 lines
{ Print out listings for Pics File Sections, Message Areas and Articles. }
{ Version 1.0 4/27/87 - Written by Byron McKay, wrote original program
from Les Archambault's Setup.pas program, added printout and usage of Epson
printer codes to spice things up - change lines noted for different printer
type. - BAM
}
{ Thanks to Les Archambault, who wrote the original Setup.pas file for PICS
This program is released freely to the public domain, unsupported, with
no gaurantees, and my heartfelt best wishes... the way it should be!
Usage:
Place on same drive and user (subdirectory) as PICS setup file, then type:
PRSETUP<CR>
IT'S ALL DOWNHILL FROM THERE!
}
Program Print_sections;
const
fname='SECTION.BB#';
version='1.0';
ver_date='8/8/86';
type
str10=string[10];
strpr=string[50];
str12=string[12];
Section_rec=
record
drive:char;
user:integer;
accs:integer;
confnum:integer;
name:str12;
desc:strpr;
mode:char;
end;
var
sect_file,temp_file: file of Section_rec;
sec_rec,temp_rec:Section_rec;
rec,i,n,x,num,err,ednum,msg_area,hi_num,lo_num:integer;
OK,found:boolean;
cur_mode,ch,dr:char;
reply:str10;
work:strpr;
new_name:str12;
line:string[80];
procedure Display;
begin
found:=false;
with sec_rec do
begin
rec:=0; hi_num:=0; lo_num:=1000;
seek(sect_file,rec);
if (cur_mode<>'Q') then
begin
writeln(lst,#27'@'); writeln(lst);
case cur_mode of
'M' : writeln(lst,#14'MESSAGE AREAS');
'F' : writeln(lst,#14'FILE AREAS');
'A' : writeln(lst,#14'ARTICLES');
end;
writeln(lst,line);
write(lst,' # ');
if (cur_mode<>'M') then write(lst,'D/U ');
write(lst,'accs ');
if (cur_mode='A') then writeln(lst,' Filename Title')
else writeln(lst,' Name Cn Description');
writeln(lst,line);
end;
while (not eof(sect_file)) and (cur_mode<>'Q') do
begin
read(sect_file,sec_rec);
if mode=cur_mode then
begin
found:=true;
write(lst,rec:3,' ');
if cur_mode<>'M' then
begin
write(lst,drive,':');
write(lst,user:2,' ');
end;
write(lst,accs:3,' ',name:12);
if confnum>0 then write(lst,confnum:2)
else write(lst,' ');
writeln(lst,' ',desc);
if lo_num>rec then lo_num:=rec;
if hi_num<rec then hi_num:=rec;
end;
if (mode='M') and (user>msg_area) then
msg_area:=user;
rec:=succ(rec);
end;
if (not found) and (cur_mode<>'Q') then writeln(lst,'No Entries Found');
end;
end;
Procedure get_reply;
begin
if OK then
begin
reply:='';
write(' > ');
readln(reply);
val(reply,num,err);
if (length(reply)>=1) and (err<>0) then ch:=upcase(reply[1])
else ch:=' ';
if (ch=' ') and (err<>0) and (cur_mode<>'X') then OK:=false;
if (cur_mode<>'X') then writeln;
end;
end;
begin {install}
clrscr;
writeln;
writeln('Pascal Integrated Communications System');
writeln(' Version ',version,' ',ver_date);
writeln;
line:='------------------------------------------------------------------------------';
Assign(sect_file,fname);
{$I-} Reset(sect_file); {$I+}
OK:=(IOresult=0);
If OK then
begin {file exists}
repeat
OK:=true; msg_area:=0;
writeln;
writeln(' EDITING PICS SYSTEM SETUP FILE ');
writeln; writeln;
writeln(' <M>.....Message Areas.');
writeln(' <F>.....File Sections.');
writeln(' <A>.....Articles.');
writeln(' <CR>....Finished.');
writeln;
write(' Enter letter');
get_reply;
if ( ch in ['A','F','M']) and (reply<>'') then cur_mode:=ch
else cur_mode:='Q';
display;
writeln(lst,^l);
until cur_mode='Q';
close(sect_file);
end
end.
end.