home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
turbopas
/
pmodem.ark
/
DEFAULT.INC
< prev
next >
Wrap
Text File
|
1987-02-22
|
3KB
|
130 lines
{********** default.inc **********}
{ default & miscellaneous }
procedure next_command;
{do next command from command file}
var
cfile : text;
begin
sourceName:= 'PMODEM.CMD';
if not do_command then write(^G);
if not do_command then
if findfile(sourceName) then begin
do_command:= true;
assign(cfile, SourceName);
reset(cfile);
end
else begin
writeln;
writeln(^G, '++ command file not found ++');
writeln;
command_file:= false;
eraseOK:= false;
end;
if do_command then begin
delay(1000);
write(^G);
if not EOF(cfile) then readln(cfile, line)
else begin
command_file:= false;
do_command:= false;
close(cfile);
end;
end;
end; {next_command}
procedure do_wait;
var
rnumb: real;
count, number : integer;
begin
writeln('WAIT');
writeln;
write('Enter TIME to wait (minutes): ');
readln(rnumb);
if rnumb< 0 then rnumb:= 0;
count:= round(600 * rnumb);
for number:= 1 to count do
delay(100);
write(^G);
end; {do_wait}
procedure disconnect;
begin
if carrier then begin
writeln('--> disconnecting...');
go_onHook;
end;
end; {disconnect}
procedure default;
var
local: data;
procedure writebool(toot: boolean);
begin
if toot then writeln('On')
else writeln('Off');
end; {writebool}
procedure prompt;
begin
write('Enter new VALUE -- ');
end; {prompt}
procedure default_menu;
begin
if eraseOK then clrScr;
eraseOK:= true;
writeln('DEFAULTS');
writeln;
write('1. BAUD ');
if hiBaud then writeln('1200')
else writeln('300');
write('2. DUPLEX ');
if duplex then writeln('Full')
else writeln('Half (echo)');
write('3. CAPTURE ');
writebool(capture);
write('4. FILTER ');
writebool(filter);
write('5. DELAY ');
writebool(delay_set);
writeln('6. WAIT ', wait, ' mins');
write('7. COMMAND FILE ');
writebool(command_file);
write('8. LOGON ');
writebool(log_on);
writeln;
end; {default_menu}
begin {default}
if first then begin
{initialize modem}
init_modem;
modem_out_line('AT M1 S0=0'); {disable auto answer}
end
else
Repeat
default_menu;
write('Enter NUMBER to toggle or change / <RET> for main menue: ');
readln(local);
if length(local)= 0 then local:= '0';
case local[1] of
'1': if hibaud then set_loBaud else set_hiBaud;
'2': duplex:= not duplex;
'3': capture:= not capture;
'4': filter:= not filter;
'5': delay_set:= not delay_set;
'6': begin
prompt;
readln(wait);
end;
'7': command_file:= not command_file;
'8': log_on:= not log_on;
end;
Until local = '0';
end; {default}