home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
turbopas
/
tkermit.lbr
/
KHELP.PQS
/
KHELP.PAS
Wrap
Pascal/Delphi Source File
|
1985-02-09
|
7KB
|
155 lines
procedure show; (* show the current parameters *)
(* This procedure lists the current state of parameters for Kermit.
There is a little cleanup to do in this area, as some are for
future expansion and some will be implemented when a DEC-20 style
command parser is implemented.
*)
begin (* show *)
writeln('Current state of parameters are:');
writeln;
writeln(tab(2), 'Filetype (Filetype): ', file_str[file_type_var],'.');
writeln(tab(2), 'Parity (PArity): ', parity_str[parity_type_var],'.');
writeln(tab(2), 'Port: (POrt):', port_str[port_type_var],'.');
writeln(tab(2), 'Escape sequence (constant): ^\ - C (Control-backslash ''C''.');
writeln(tab(2), 'Packet size (Size): ', packet_size,'.');
writeln(tab(2), 'Number of pad characters (Npad): ', npad,'.');
writeln(tab(2), 'Pad character to send (PAD): char(',pad,').');
writeln(tab(2), 'Check type (Checktype): ',chk_type,'.');
writeln(tab(2), 'Debug mode (Debug): ', debug_mode, '.');
writeln(tab(2), 'Number of retries: ', maxtry, '.');
writeln(tab(2), 'Printer mode (PRinter): ', print_mode, '.');
writeln;
writeln('To change a parameter, type: SET <parameter> <value>');
writeln('Valid parameters are shown in parentheses. Abbreviations are capitalized.');
end; (* show *)
procedure help;
(* This procedure just lists the valid commands that can be typed on Turbo
Kermit.
*)
begin
clrscr;
writeln('The following are valid commands:');
writeln(tab(5),'Bye - Logout host, return to CP/M.');
writeln(tab(5),'Connect - Connect to remote host and act as a terminal.');
writeln(tab(5),'Exit - Return to CP/M.');
writeln(tab(5),'Finish - Shut down remote server.');
writeln(tab(5),'Get - Get the specified file(s) from the host.');
writeln(tab(5),'Help - Display this help message.');
writeln(tab(5),'Quit - Return to CP/M.');
writeln(tab(5),'Receive - Receive a file from remote host.');
writeln(tab(5),'SENd - Send a file to remote host.');
writeln(tab(5),'SET - Set local Kermit parameter.');
writeln(tab(5),'SHow - Show the current parameters.');
writeln(tab(5),'Ctrl-D to abort transfer.');
writeln;
writeln(tab(3),'Allowable abbreviations are shown in capital letters.');
end;
(*----------------------------------------------------------------*)
procedure set_param; (* set a prameter *)
(* This procedure is several case statements that read the arguments
and try to adjust the parameters accordingly. It will probably be
replaced at a later time with a DEC-20 style command parser, so not
much work will be done on it now to clean it up.
*)
var
temp, code : integer;
begin (* set_param *)
case arg1[1] of
'D', 'd' : begin
if (arg2 = 'ON') or (arg2 = 'on') then
begin
debug := true;
debug_mode := 'on';
end
else
begin
debug := false;
debug_mode := 'off';
end;
writeln('Debug mode is now ', debug_mode);
end;
'F', 'f' : begin
case arg2[1] of
'A', 'a' : file_type_var := ascii;
'B', 'b' : file_type_var := binary;
else
writeln('Unknown file type.');
end; (* case *)
writeln('Filetype set to: ', file_str[file_type_var]);
end;
'P', 'p' : begin
case arg1[2] of
'A','a' : begin
case arg2[1] of
'N', 'n' : parity_type_var := no_parity;
'M', 'm' : parity_type_var := mark_parity;
'S', 's' : parity_type_var := space_parity;
'E', 'e' : parity_type_var := even_parity;
'O', 'o' : parity_type_var := odd_parity;
else
writeln('Parity type ', arg2, ' not allowed.');
end; (* case *)
writeln('Parity set to: ', parity_str[parity_type_var]);
end;
'O','o' : begin
case arg2[1] of
'R', 'r' : begin
port_type_var := comm;
port := 2;
port_iobyte :=
(base_iobyte and $fc) or port;
end;
'U', 'u' : begin
port_type_var := uc1;
port := 3;
port_iobyte := (base_iobyte
and $fc) or port;
end;
else
writeln('Invalid port selection.');
end; (* case *)
writeln('Port set to ', port_str[port_type_var]);
end;
'R','r' : begin
if (arg2 = 'ON') or (arg2 = 'on') then
begin
printing := true;
print_mode := 'on';
end
else
begin
printing := false;
print_mode := 'off';
end;
writeln('Print logging is now ', print_mode);
end;
end; (* case *)
end;
'R', 'r' : begin
val(arg2, temp, code);
if code <> 0 then
writeln('Retry count ', arg2, ' not allowed.')
else
begin
maxtry := temp;
writeln('Retry count set to ', retry, '.');
end;
end;
else
begin
writeln('Parameter ', arg1, ' not allowed.');
end;
end; (* case *)
end; (* set_param *)