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
/
DIAL.INC
< prev
next >
Wrap
Text File
|
1991-08-11
|
4KB
|
142 lines
{********** dial.inc **********}
{ auto dial reoutines }
procedure call;
{auto dial}
label calloop;
var
ch,ch1: char;
temp2: data;
temp4, line2: ldata;
function SubString(mainstring: data2; startNo, endNo: integer): dataa;
var
len: integer;
begin
len:= endNo - startNo;
if len < 1 then len:= 0;
SubString:= copy(mainstring, startNo, len + 1);
end; {SubString}
procedure Phone_Directory;
var
show_directory: boolean;
position: integer;
local: char;
temp: string[95];
begin
if slowbaud then set_hiBaud;
slowbaud:= false;
logline:= '';
show_directory:= false;
{ phone:= }
if length(line)<2 then begin {line may already have value}
show_directory:= true;
writeln;
writeln(' Phone Directory');
writeln('-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
end
else begin
delete(line,1,1);
eraseOK:= false;
end;
for I:= 1 to phone_list do begin
temp:=phone[I];
if temp[25]= '@' then begin
temp:= SubString(phone[I], 26, length(phone[I]));
position:= pos('/',temp);
if position<1 then position:= 0;
logline:= SubString(temp, position+1, length(temp));
temp:= SubString(phone[I], 1, 24 + position);
end;
if show_directory then begin
writeln(temp);
if I = 6 then writeln;
end;
end;
if show_directory then begin
if phone_list> 3 then writeln('-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-');
writeln;
write('letter, number / <RET> for menue: ');
readln(line);
end;
if length(line)>0 then begin
line[1]:= upCase(line[1]);
if line[1] in ['A'..Chr(phone_list + 64)] then
line:= copy(phone[ord(line[1])-$40],25,95) {get phone number}
else if line[1] in [Chr(phone_list + 65)..'Z'] then line:= '';
if length(line)>0 then begin
if eraseOK then clrScr;
if line[1]= '@' then begin
autolog:= true;
delete(line,1,1);
position:= pos('/',line);
if position<1 then position:= 0;
logline:= SubString(line, position+1, length(line));
line:= SubString(line, 1, position-1);
end
else autolog:= false;
if line[1]= '~' then begin
delete(line,1,1);
slowbaud:= true;
end;
if slowbaud and not hiBaud then slowbaud:= false
else if slowbaud then set_loBaud;
end
end;
end; {Phone_Directory}
begin {call}
temp2:= 'Y'; line2:= '';
write('CALL ');
if length(phone_buffer)>0 then write('(', phone_buffer, ' previous)');
writeln;
Phone_Directory;
if length(line)>0 then begin
if line[1]= ' ' then line:= phone_buffer
else phone_buffer:= line;
delay(300);
CALLOOP:
writeln('dialing ',line);
ch:= CR;
go_Dial(line);
while ch in [CR, LF] do begin
if modem_in_ready then ch:= getMod;
if keyPressed then begin
ch1:= chr(bdos(1));
modem_out(' ');
end;
end;
if carrier then delay(500);
if carrier then terminal_mode
else begin
temp1:= getMod;
if upCase(temp2)= 'Y' then begin
write('Try again (Y/[N]/R)? ');
temp2:= upCase(chr(bdos(1)));
writeln;
if length(temp2)= 0 then temp2:= 'N';
end;
case temp2[1] of
'Y': goto calloop;
'R': begin
time;
if X<> ^X then goto calloop;
end;
end;
end;
end;
if not carrier then begin
if slowbaud then set_hiBaud;
eraseOK:= true;
end
else eraseOK:= false;
modem_out(^@); {any chr to hang up if dialing}
end; {call}