home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
COMMS
/
PMODEM.ARC
/
MAIN.INC
< prev
next >
Wrap
Text File
|
1991-08-11
|
2KB
|
87 lines
{********** main program loop **********}
procedure main_menue;
begin
timeout;
if first then begin
default;
eraseOK:= false;
if length(line)= 0 then line:= 'C'; {call}
if carrier then line:= '';
first:= false;
end;
if (length(line)= 0) and not command_file then begin
if eraseOK then resetCRT;
eraseOK:= true;
write(' Main Menue ');
if carrier then writeln('(carrier)') else writeln('(no carrier)');
writeln;
if not carrier then begin
writeln('(C)all (H)ost mode');
writeln('(T)erminal mode (D)efaults');
writeln('(W)ait (Q)uit');
end
else begin {carrier}
writeln('(T)erminal mode (W)ait');
writeln('(S)end a file (XMODEM) (D)efaults');
writeln(' (SA) ASCII text (X) Disconnect');
writeln('(R)eceive a file (XMODEM) (Q)uit');
writeln(' (RC) Checksum (RX) CRC');
end;
writeln;
write('Enter SELECTION: ');
readln(line);
end;
end; {main_menu}
procedure action;
begin
if command_file then next_command;
if length(line)= 0 then line:= 'Y';
case upCase(line[1]) of
'C': begin
if eraseOK then clrScr;
call;
end;
'T': begin
if eraseOK then clrScr;
terminal_mode;
end;
'K': port[StatusPort]:= $35; {command byte}
{*** remember 'timein' if disk access ***}
'S': send_a_file;
'R': receive_a_file;
'A': send_ascii;
'H': begin
if eraseOK then clrScr;
host;
end;
'W': do_wait;
'D': default;
'X': begin
if eraseOK then clrScr;
eraseOK:= false;
disconnect;
end;
'Q': timein;
end;
if line[1] in ['Q', 'q'] then line:= 'Q' else line:= '';
end; {action}
{********** program starts here **********}
begin
line:= getTail; {CP/M command tail}
first:= true;
clrScr;
writeln(^I^I + 'P M O D E M v1.1a communications program');
writeln;
repeat
{this is the main program loop}
main_menue;
action;
until line= 'Q';
writeln;
disconnect;
writeln('++ Return to System ++');
end. {program}