home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
153.img
/
TELES.ZIP
/
SYSOPUT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-07-23
|
6KB
|
223 lines
{$R-} {Range checking off}
{$B+} {Boolean complete evaluation on}
{$S+} {Stack checking on}
{$I+} {I/O checking on}
{$N-} {No numeric coprocessor}
{$V-}
Unit SysopUt;
Interface
Uses
Crt,
Dos,
Turbo3,
Common;
{function mln(i:astr; l:integer):astr;
function mn(i,l:integer):astr;
function okfile(fn:astr):boolean;
function align(fn:astr):astr;
function vdir(var d:astr):boolean;
procedure fix(var fn:astr);
procedure uedit(usern:integer);}
procedure voteprint;
{procedure tedit;
procedure copyfile(srcname,destname:astr);}
procedure dosj(cmd:char);
Implementation
var topheap:^byte;
{ i1:astr;
ix:array[1..9] of string[79];
found,donedos,dld,d1,d2,done,abort:boolean;
c1,c2,c3:integer;
f,f1:file of byte;
x:byte;
cd:astr;
filenamef,s1,s2,s3:astr;
all:boolean;
chksum:byte;
crc:integer;
dta:string[44];
ft:byte;}
lastvar:byte;
function mln(i:astr; l:integer):astr;
begin
while length(i)<l do i:=i+' ';
mln:=i;
end;
function mn(i,l:integer):astr;
begin
mn:=mln(cstr(i),l);
end;
function okfile(fn:astr):boolean;
begin
okfile:=(pos('.LST',FN)=0) and (pos('.DAT',fn)=0) and (pos('.BRD',fn)=0)
and (pos('.DIR',fn)=0) and (pos('.LOG',fn)=0);
if (not so) and (pos('.TXT',fn)=0) and (pos('.MSG',fn)=0)and (pos('.???',FN)=0)
then okfile:=false;
end;
function align(fn:astr):astr;
var f,e,t:astr; c,c1:integer;
begin
c:=pos('.',fn);
if c=0 then begin
f:=fn; e:=' ';
end else begin
f:=copy(fn,1,c-1); e:=copy(fn,c+1,3);
end;
while length(f)<8 do f:=f+' ';
while length(e)<3 do e:=e+' ';
c:=pos('*',f); if c<>0 then for c1:=c to 8 do f[c1]:='?';
c:=pos('*',e); if c<>0 then for c1:=c to 3 do e[c1]:='?';
align:=f+'.'+e;
end;
function vdir(var d:astr):boolean;
var x:boolean;
begin
if d[length(d)]='\' then d:=copy(d,1,length(d)-1);
(* if (d='DLOADS') or (d='GFILES') then x:=true else x:=false;
if so AND (D='.') then x:=true; *)
x:=true;
vdir:=x;
end;
procedure fix(var fn:astr);
var i,i1:astr; c1,c2:integer; ok:boolean;
begin
cd:=systat.gfilepath+'';
(* c1:=pos('\',fn); ok:=true;
if c1<>0 then begin
i:=copy(fn,1,c1-1);
fn:=copy(fn,c1+1,15);
if not vdir(i) then ok:=false;
end else i:='';*)
if i='' then i:=cd;
if fn='' then fn:='*.*';
fn:=i+align(fn);
if (pos('.MSG',fn)=0) and (pos('.TXT',fn)=0) and (pos('?',fn)=0) and (not so) then ok:=false;
if not ok then fn:='';
if not okfile(fn) then fn:='';
end;
{$I DOSP1.PAS}
{
procedure eed;
var i1,i2,ii:integer; c:char; ij:astr; s:astr;
begin
prt('Protocal number to delete? '); input(s,1); ii:=value(s);
if (ii>0) and (ii<=numprotocals) then begin
prompt(protocals[ii].descr+' Delete it? ');
if yn then begin
numprotocals:=numprotocals-1; for i1:=ii to numprotocals do
protocals[i1]:=protocals[i1+1];
rewrite(xp); for i1:=1 to numprotocals do write(xp,protocals[i1]);
close(xp);
end;
end;
end;
procedure eem;
var i1,i2,ii:integer; c:char; ij:astr; s:astr;
begin
prt('Protocal number to edit? '); input(s,1); ii:=value(s);
if (ii>0) and (ii<=numprotocals) then begin with protocals[ii] do
repeat
cls;
print(' Protocal : '+cstr(ii));
print('1. Description: '+descr);
print('2. Send out : '+scmd);
print('3. Recieve in : '+rcmd);
print('4. Xfer Ok : '+cstr(xferok));
print('Q. Quit');
nl; prt('Which? '); onek(c,'Q1234');
case c of
'1':begin prt('New description? '); mpl(30); inputl(descr,30); end;
'2':begin
nl;
print('@1=Baud @2=Port @3=Filename');
prt('New send out command line? '); mpl(40);
input(scmd,40);
end;
'3':begin
nl;
print('@1=Baud @2=Port @3=Filename');
prt('New recieve command line? '); mpl(40);
input(rcmd,40);
end;
'4':begin prt('Xfer Ok Value? '); input(s,1); xferok:=value(s); end;
end;
until (c='Q') or hangup;
reset(xp); seek(xp,ii-1); write(xp,protocals[ii]); close(xp); c:=' ';
end;
end;
procedure eei;
var i1,i2,ii:integer; c:char; ij,s:astr;
begin
prt('Protocal number to insert before? '); input(s,1); ii:=value(s);
if (ii>5) and (ii<=numprotocals+1) and (numprotocals<19) then begin
numprotocals:=numprotocals+1; for i1:=numprotocals downto ii do
protocals[i1]:=protocals[i1-1];
with protocals[ii] do begin
descr:='NEW Protocal';
xferok:=-1;
end;
rewrite(xp); for i1:=1 to numprotocals do write(xp,protocals[i1]);
close(xp);
end;
end;
procedure Exproedit;
var i1,i2,ii:integer; c:char; ij:astr; abort,next:boolean; st:astr;
begin
if checkpw then
repeat
cls; abort:=false;
cl(0);printacr('NN Description of Protocal Xfer Ok Code',abort,next);
cl(9);printacr('-- ------------------------------ ============',abort,next);
ii:=1;
while (ii<=numprotocals) and (not abort) do
with protocals[ii] do begin
st:=mn(ii+5,2)+' '+mln(descr,30)+' '+mn(xferok,6);
printacr(st,abort,next);
ii:=ii+1;
end;
nl; prt('D)elete, I)nsert, M)odify, Q)uit :'); onek(c,'QDIM');
case c of
'D':eed;
'M':eem;
'I':eei;
end;
until (c='Q') or hangup;
end;
}
procedure dosj(cmd:char);
begin
cd:='GFILES';
topheap:=ptr(seg(lastvar),ofs(lastvar));
release(topheap);
case upcase(cmd) of
'U':uedit(usernum);
'E':begin
prompt('Filename: ');
mpl(12);
input(ix[2],12);
tedit;
end;
end;
end;
END.