home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
189.img
/
TCS120S.ZIP
/
DOEXT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-03-21
|
6KB
|
163 lines
function doext (mode,proto:char; uddir,fn:lstr; baud,comm:integer):integer;
var cmdline,switches,dirsave,cddir:lstr;
baudst,commst:mstr;
retcd:integer;
function getdszfn:mstr;
begin
if exist (forumdir+'DSZ.COM') then getdszfn:='DSZ.COM'
else if exist (forumdir+'DSZ.EXE') then getdszfn:='DSZ.EXE';
end;
function getjmodemfn:mstr;
begin
if exist (forumdir+'JMODEM.COM') then getjmodemfn:='JMODEM.COM'
else if exist (forumdir+'JMODEM.EXE') then getjmodemfn:='JMODEM.EXE';
end;
function getlynxfn:mstr;
begin
if exist (forumdir+'LYNX.EXE') then getlynxfn:='LYNX.EXE'
else if exist (forumdir+'LYNX.COM') then getlynxfn:='LYNX.COM';
end;
function getsuperkfn:mstr;
begin
if exist (forumdir+'SUPERK.COM') then getsuperkfn:='SUPERK.COM'
else if exist (forumdir+'SUPERK.EXE') then getsuperkfn:='SUPERK.EXE';
end;
begin
getdir (0,dirsave); { drive: 0 = cur. 1 = A: etc. - save cur. dir. }
{ dirsave:=forumdir;
if dirsave[length(dirsave)]<>'\' then dirsave:=dirsave+'\'; }
if uddir[length(uddir)]='\'
then cddir:=copy(uddir,1,length(uddir)-1)
else cddir:=uddir;
writeln (usr,^M'[Changing Directories to '+cddir+']'^M);
chdir (cddir);
{ cddir:='';
cddir:=cddir+uddir;
if uddir[length(uddir)]<>'\'then cddir:=cddir+'\';
cddir:=cddir+fn; }
str (baud:3,baudst);
str (comm:1,commst);
if mode='R' then begin
case proto of
'Z':cmdline:=dirsave+'\'+getdszfn;
'J':cmdline:=dirsave+'\'+getjmodemfn;
'L':cmdline:=dirsave+'\'+getlynxfn;
'G':cmdline:=dirsave+'\'+getdszfn;
'O':cmdline:=dirsave+'\'+getdszfn;
'1':cmdline:=dirsave+'\'+getdszfn;
'S':cmdline:=dirsave+'\'+getsuperkfn;
'K':cmdline:=dirsave+'\'+getsuperkfn;
'R':cmdline:=dirsave+'\'+getdszfn;
'P':cmdline:=dirsave+'\'+getdszfn;
end
end;
if mode='R' then begin
case proto of
'Z':switches:=' port '+strr(dszport)+' speed '+baudst+' rz '+fn;
'J':switches:=' R'+commst+' '+cddir+'\'+fn;
'L':switches:=' R /'+commst+' /'+baudst+' '+cddir;
'G':switches:=' port '+strr(dszport)+' speed '+baudst+' rb -g '+fn;
'O':switches:=' port '+strr(dszport)+' speed '+baudst+' rx -o '+fn;
'1':switches:=' port '+strr(dszport)+' speed '+baudst+' rb -o '+fn;
'S':switches:='';
'K':switches:='';
'R':switches:=' port '+strr(dszport)+' speed '+baudst+' rz -r '+fn;
'P':switches:=' port '+strr(dszport)+' speed '+baudst+' rz -w '+fn;
end
end;
if mode='S' then begin
case proto of
'Z':cmdline:=dirsave+'\'+getdszfn;
'J':cmdline:=dirsave+'\'+getjmodemfn;
'L':cmdline:=dirsave+'\'+getlynxfn;
'G':cmdline:=dirsave+'\'+getdszfn;
'O':cmdline:=dirsave+'\'+getdszfn;
'1':cmdline:=dirsave+'\'+getdszfn;
'S':cmdline:=dirsave+'\'+getsuperkfn;
'K':cmdline:=dirsave+'\'+getsuperkfn;
'R':cmdline:=dirsave+'\'+getdszfn;
'P':cmdline:=dirsave+'\'+getdszfn;
end
end;
if mode='S' then begin
case proto of
'Z':switches:=' port '+strr(dszport)+' speed '+baudst+' sz '+fn;
'J':switches:=' S'+commst+' '+fn;
'L':switches:=' S /'+commst+' /'+baudst+' '+fn;
'G':switches:=' port '+strr(dszport)+' speed '+baudst+' sb -g '+fn;
'O':switches:=' port '+strr(dszport)+' speed '+baudst+' sx -o '+fn;
'1':switches:=' port '+strr(dszport)+' speed '+baudst+' sb -o '+fn;
'S':switches:='';
'K':switches:='';
'R':switches:=' port '+strr(dszport)+' speed '+baudst+' sz -r '+fn;
'P':switches:=' port '+strr(dszport)+' speed '+baudst+' sz -w '+fn;
end
end;
write (^B);
if (proto='Z') or (proto='G') or (proto='O') or (proto='1') or (proto='R')
or (proto='P') then
begin
if (not exist (dirsave+'\DSZ.COM')) and (not exist (dirsave+'\DSZ.EXE'))
then begin
writeln;
writeln (^G^R'DSZ Protocols are not available at the moment!');
writeln ('Sysop does not have DSZ.COM or DSZ.EXE in the current directory.');
writeln ('Please notify him!');
writeln;
writeln (usr,^M'[Changing Directories back to '+dirsave+']');
chdir (dirsave);
exit;
end;
end;
if (proto='J') then begin
if not exist (dirsave+'\JMODEM.COM') then
begin
writeln;
writeln (^G^R'Jmodem Protocol is not available at the moment!');
writeln ('Sysop does not have JMODEM.COM in the current directory.');
writeln ('Please notify him!');
writeln;
writeln (usr,^M'[Changing Directories back to '+dirsave+']');
chdir (dirsave);
exit;
end;
end;
if (proto='L') then begin
if not exist (dirsave+'\LYNX.EXE') then
begin
writeln;
writeln (^G^R'Lynx Protocol is not available at the moment!');
writeln ('Sysop does not have LYNX.EXE in the current directory.');
writeln ('Please notify him!');
writeln;
writeln (usr,^M'[Changing Directories back to '+dirsave+']');
chdir (dirsave);
exit;
end;
end;
if ((proto='K') or (proto='S')) then begin
if not exist (dirsave+'\SUPERK.COM') then
begin
writeln;
writeln (^G^R'Super8k/K9Xmodem Protocol is not available at the moment!');
writeln ('Sysop does not have SUPERK.COM in the current directory.');
writeln ('Please notify him!');
writeln;
writeln (usr,^M'[Changing Directories back to '+dirsave+']');
chdir (dirsave);
exit;
end;
end;
starttimer (numminsxfer);
runext (retcd,cmdline,switches);
stoptimer (numminsxfer);
writeln (usr,^M'[Changing Directories back to '+dirsave+']');
chdir (dirsave);
doext:=retcd;
setparam (usecom,baudrate,parity);
end;