home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc2
/
dialv23.lzh
/
DIAL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-09-05
|
28KB
|
921 lines
Program Dial;
{
This program is a screen oriented Hayes SmartModem dialer for the DEC Rainbow.
It is written in Turbo Pascal 3.0 for DOS. All operation has been done under
DOS 2.11. See DIAL.DOC for more details.
To Recompile this program you MUST change the Minimum and Maximum dynamic memory
in the Turbo Pascal compiler. To do this follow this sequence of commands:
>O ; compiler options
>C ; select .COM file
>I ; change minimum dynamic memory
:50 ; set it to 50
>A ; change maximum dynamic memory
:100 ; set it to 100
>Q ; quit
>C ; compile a file
:DIAL ; the name of this program
I owe much to the authors of several packages I used to build this: mostly
made possible by B. Eiben of DEC, whose efforts in managing public accounts on
DEC's MARKET system brought together all the tools I needed. This program is
placed in the public domain and any are welcome to copy it and/or modify it as
long as it is not used for any commercial purpose.
Written by Ted Weirich in July 1985.
Last modified August 3, 1985.
Broken into smaller pieces.
Added environment variable support to find command.com and dial file.
Added push capability off the interrupt key.
Improve coding some.
Modified Sept. 5 1985 By David Horowitz
Added 2400 Baud support
Added Support for USRobotics 2400 Courier
Note: The source is now set for the USR 2400. To set it for a hayes
modem you must change the Modem_Type Constant back to 1.
}
{********************************* Type Declarations *************************}
Type
str61 = String[61];
str80 = String[80];
str127 = String[127]; {CCP command string}
str133 = String[133];
stringlong = String[150];
str255 = String[255];
register_set = Record case Integer of
1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : INTEGER);
2: (AL,AH,BL,BH,CL,CH,DL,DH : Byte);
End;
dir_rec = Record {Internal directory format}
Num : String[15]; {Phone number}
Desc : String[16]; {Destination description}
DosCmd : String[34]; {DOS cmd when party answers}
End;
{The following are various options you may use with Fast Video:}
fv_subfunction_type = (Char_Attrib,Attrib_Only,Char_Only);
{This is used when changing comm port parameters}
__CommCtrlBlock = RECORD
ModemCtrl : Byte;
StopBits : Byte;
DataBits : Byte;
Parity : Byte;
RCVBaud : Byte;
XMTBaud : Byte;
XONChar : Byte;
XOFFChar : Byte;
RCVXON : Byte;
XMTXON : Byte;
AltBufSize : Integer;
BuffAddrOffset : Integer;
BuffAddrSeg : Integer;
End;
{This is used for all comm port I/O}
__IOCTLPacketType = RECORD
Fnction : Byte;
Func_retC : Byte;
Character : Char;
Char_Stat : Byte;
Buffer : Byte; {either CCB or 0}
end;
CommInType = RECORD {With each character read in, there's}
Char : Char; {the character itself, and a byte }
Error : Byte; {indicating any data errors }
end;
{These are the extended communications functions}
__SubFunction = ( ProgramDev, ProgramDefault, SetDefBuf,
ReadDevSetup, EnableRecvIntr, DisableRecvIntr,
ReadInStat, ReadChar, GetChar, ReadOutStat,
WriteChar, PutChar, XMTImmed, ReadModem,
SetModem, XMTBreak, StopBreak, SetRecvIntr,
ResetRecvIntr, EmptyBufIntr, ResetEmptyBufIntr,
SetIntrRoutine, ResetDevIntr );
ParityType = ( NoChange, Even, Odd, None ); {Possible parity values}
DataBitsType = (DBNoChange, DB5, DB6, DB7, DB8, DB7S, DB7M );
{*************************** Constant Declarations *************************}
Const
version_string = 'Turbo DIAL V2.3 for DOS and the DEC Rainbow, 3-Aug-1985';
Modem_Type = 2; {Hayes = 1}
{USR 2400 = 2}
Dial_File = 'dialnum.txt';
Successful = 255;
Unsuccessful = 0;
max_dir_entries = 100; {Max # of phone numbers in dir table}
fsl = 4; {first line written on screen}
lsl = 22; {last line written on screen}
nls = 19; {Number of lines on the screen}
hayes_delay = 50; {ms we wait between sending chars to}
{the Hayes SmartModem}
USR2400_delay = 50;
msg_delay = 1000; {time we wait while user reads the}
{warning or fatal message}
autobaud_char = 13; {send this char nauto_times for good con}
nauto_times = 3; {send autobaud_char this many times}
{$I FVCONST.INC }
{codes returned on a level 1 keyboard input call - hex}
{$I KEYDFNS.INC }
{**************************** Variable Declarations *************************}
Var
mcode : integer;
dirfil : Text;
commandline : Str255;
dir_entry : Array[1..Max_Dir_Entries] of Dir_Rec;
max_dir_ent : integer;
cur_dir_ent : integer;
top_dir_ent : integer;
bot_dir_ent : integer;
keepgoing : Boolean;
TextToPrint : Str133;
lv1_fnc : boolean;
lv1_shft : boolean;
lv1_ctrl : boolean;
lv1_caps : boolean;
dummylogical : boolean;
Regs : Register_Set;
i : integer;
{Storage for the comm port stuff}
__Buffer1 : String[255]; {The next 2 lines set up comm}
__Buffer2 : String[255]; {data buffer of 512 bytes }
DefaultBaud : Integer;
DefaultDataBits : DataBitsType;
DefaultParity : ParityType;
DefaultStopBits : Real;
CommIn : CommInType;
__SetSerialIO : __IOCTLPacketType; {These two variables must be}
__CCB : __CommCtrlBlock; {defined contiguously. }
__IOCTLPacket : __IOCTLPacketType;
{******************************* Misc or Global Functions *******************}
{$I FINDENV.INC }
Procedure Execute_Command ( command_line : Str255 ) ; Forward;
Function IMIN( x : Integer; y : Integer) : Integer;
{
Return the maximum of two integers.
}
Begin
If x <= y Then IMIN := x Else IMIN := y;
End;
Function IMAX( x : Integer; y : Integer) : Integer;
{
Return the minimum of two integers
}
Begin
If x >= y Then IMAX := x Else IMAX := y;
End;
{$V-}
Function StrMatch( S1 : Str255; S2 : Str255 ) : Boolean;
{
Use this function to compare two strings of perhaps unequal length without
regard for case. Note, anything matches the null string.
}
Var
i : Integer;
result : Boolean;
Begin
i := 1;
result := true;
While (i <= Length(S1)) and (i <= Length(S2)) and result Do
Begin
result := (UpCase(S1[i]) = UpCase(S2[i]));
i := i + 1;
End;
StrMatch := result;
End;
{$V+}
{******************************* Comm Port Routines *************************}
{
The following routines were taken from COMLIB.INC as found in the TC package
(Rainbow VT220 emulator) on MARKET. Thanks.
}
{$I COMMLIB.INC }
{*************************** Keyboard Input Routines *************************}
{
Antique LCTERM sources, FUNKEY.PAS, and other examples form the basis for
the following routines for level 1 and 2 keyboard input. Thanks.
}
{$I KEYBOARD.INC }
{*************************** Fast Video Routines *****************************}
{
The example FASTVID.PAS from MARKET is the basis for the following routine.
}
Procedure FastVideo (VAR Text : Str133; Attrib : BYTE;
Subfunc : FV_Subfunction_type;
TextLength, TRow, TCol : INTEGER);
{
This procedure sends a line to the screen via the high speed video firmware.
Sample Call:
TextToPrint := 'aBcDeFgHiJkLmNoPqRsTuVwXyZAbCdEfGhIjKlMnOpQrStUvWxYz';
Attributes := FUnder;
FV_Subfunction := Char_Attrib;
TextToPrintLength := LENGTH(TextToPrint);
FastVideo(TextToPrint, Attributes, FV_Subfunction,TextToPrintLength,Row,Col);
In order to write to (1,1), you must disable the cursor.
The routine to turn off the cursor is: Result.DI := 8;
Intr(24,Result);
To reenable the cursor: Result.DI := 10;
Intr(24,Result);
}
Const
FastVidDI : INTEGER = 20; {Subfunction in DI to call Fast Video function}
Var
TextString, AttributeString : Str133; {Need to set up these locals}
{so they are in the same}
{data segment area.}
Result : Register_Set; {Data registers used for MSDOS interrupts}
J : Integer;
Begin
{Fill up attribute string with codes. One extra byte to fill it out}
For J := 1 to Textlength+1 do AttributeString[j] := chr(Attrib);
AttributeString[0] := chr(Textlength+1);
TextString := Text;
With Result Do Begin {Load up the necessary registers.}
AX := Ord(Subfunc); {Put the Subfunction selection into the AX Reg}
{Put the row and col # into lower BX and upper BX respectively}
Mem[Seg(BX) : Ofs(BX)] := TRow;
Mem[Seg(BX) : Ofs(BX) + 1] := TCol;
{Put the length of the string (or its attributes) in CX}
CX := TextLength;
{Stuff the offsets of the text & attribute strings in SI & DX}
{Add 1 to them to get past the length byte in [0]}
DX := Ofs(AttributeString) + 1;
SI := Ofs(TextString) + 1;
{Make sure the Base Pointer shows the Segment of the strings. These}
{MUST be in the same segment, This is why we set up the local variables.}
BP := SEG(TextString);
DI := FastVidDI; {Put the proper value into the DI Reg for Fast Video.}
End;
INTR(24,Result);
End; {Procedure FastVideo}
Procedure ClearVidLine( l : integer);
{
Use this instead of TURBO's CLREOL for erasing a line on the screen.
}
Var
tt : Str133;
Begin
If (l >= 1) and (l <= 24) Then
Begin
If l = 1 Then
Begin
Regs.DI := 8; {Turn cursor off}
Intr(24,Regs);
End;
FillChar(tt,81,' ');
tt[0] := char(80);
FastVideo(tt, FNormal, Char_Attrib, 80, l, 1);
If l = 1 Then
Begin
Regs.DI := 10; {Turn cursor back on}
Intr(24,Regs);
End;
End;
End;
{$V-}
Procedure MsgLine(t:str133;Atr:Byte);
{
Use this procedure to write info on line 24, text centered. Position
the cursor just after the text.
}
Var
x,y : Integer;
tt : Str133;
Begin
ClearVidLine(24);
x := length(t);
y := (80-x) div 2;
tt := t;
FastVideo(tt, atr, char_Attrib, x, 24, y);
GotoXY(x+y+1,24);
Delay(msg_delay);
End;
{$V+}
Procedure ReverseLine(line:integer);
{
Use this procedure to set an existing line with data on it to reverse video
This line is assumed to be a phone entry line, and we don't overwrite the
"static" information written by DrawBox.
}
Var
x : integer;
tt : Str133;
Begin
x := cur_dir_ent - top_dir_ent + fsl;
FillChar(tt,75,' ');
tt[0] := char(75);
FastVideo(tt, FReverse, Attrib_Only, 75, x, 5);
End;
Procedure NormalLine(line:integer);
{
Use this procedure to set an existing line with data on it to normal video
See ReverseLine for more information.
}
Var
x : integer;
tt : Str133;
Begin
x := cur_dir_ent - top_dir_ent + fsl;
FillChar(tt,75,' ');
tt[0] := char(75);
FastVideo(tt, FNormal, Attrib_Only, 75, x, 5);
End;
Procedure DrawBox;
{
Draw a border around the screen and put titles in it, ready for directory data.
}
Var
j : Integer;
fc : Char;
tt : Str133;
Begin
Regs.DI := 8; {Disable cursor so we can write at (1,1)}
Intr(24,Regs);
Clrscr;
fc := chr(fm_horz); {Write top side of box}
FillChar(tt,80,fc);
tt[0] := chr(80);
tt[1] := chr(fm_ulc);
tt[80] := chr(fm_urc);
FastVideo(tt, FNormal,Char_Attrib, 80, 1, 1);
FillChar(tt,80,' ');
tt[0] := chr(80);
tt[1] := chr(fm_vert);
tt[80] := chr(fm_vert);
FastVideo(tt, FNormal, Char_Attrib, 80, 2,1);
tt := ' Telephone Description Dos Command';
tt := tt + ' ';
tt[0] := chr(78);
FastVideo(tt, FReverse, Char_Attrib, 78, 2,2);
fc := chr(fm_horz);
FillChar(tt,80,fc);
tt[0] := chr(80);
tt[1] := chr(fm_ltee); {Write line under titles, line 3}
tt[3] := chr(fm_ttee);
tt[80] := chr(fm_rtee);
FastVideo(tt, FNormal,Char_Attrib, 80, 3, 1);
tt := ' ';
tt[1] := chr(fm_vert); {Write sides of box}
tt[3] := chr(fm_vert);
for j := fsl to lsl do begin
tt[2] := chr(j-fsl+65);
FastVideo(tt, FNormal, Char_Attrib, 4, j, 1);
FastVideo(tt, FNormal, Char_Attrib, 1, j, 80);
end;
fc := chr(fm_horz);
FillChar(tt,80,fc);
tt[1] := chr(fm_llc); {Write bottom side of box}
tt[3] := chr(fm_btee);
tt[80] := chr(fm_lrc);
tt[0] := chr(80);
FastVideo(tt, FNormal,Char_Attrib, 80, 23, 1);
Regs.DI := 10; {Re-enable cursor}
Intr(24,Regs);
End; {Procedure DrawBox}
Procedure PaintScreen(top:integer;cur:integer);
{
Fill the box with directory data. We starting writing with entry top and when
done, reverse video the entry cur.
}
Var
i, j, ndx, l, ttp : integer;
tt : Str133;
Begin
DrawBox;
ndx := top;
top_dir_ent := top;
For i := 1 to nls do begin
If i > max_dir_ent Then l := 0 Else l := length(dir_entry[ndx].num);
If l > 0 Then
Begin
tt := dir_entry[ndx].num;
FastVideo(tt, FNormal, Char_Attrib, Length(tt), i+fsl-1, 5);
tt := dir_entry[ndx].desc;
FastVideo(tt, FNormal, Char_Attrib, Length(tt), i+fsl-1, 20);
tt := dir_entry[ndx].doscmd;
FastVideo(tt, FNormal, Char_Attrib, Length(tt), i+fsl-1, 40);
bot_dir_ent := ndx;
End
Else
Begin
FillChar(tt,80,' ');
tt[0] := chr(75);
FastVideo(tt, FNormal,Char_Attrib, 75, i+fsl-1, 5);
End;
ndx := ndx + 1;
End;
ReverseLine(cur);
End;
{***************************** Phone Directory Routines **********************}
Function ReadDirectory : Boolean;
{
Read the disk file and remember all the entries in the in-core data structure
Return true if we read the file and had no major problems, false if the caller
shouldn't proceed.
}
Var
i : Integer;
typ_char : char;
sep_char : char;
rec_data : string[70];
file_name : str255;
result : Boolean;
Begin
result := true;
For i := 1 to max_dir_entries do
with dir_entry[i] do begin
num := '';
desc := '';
doscmd := '';
end;
file_name := 'DIAL';
file_name := find_env(file_name) + dial_file;
Assign(dirfil,file_name);
{$I-} Reset(dirfil); {$I+}
i := IOResult;
If i <> 0 Then
Begin
Str(i,rec_data);
MsgLine(('?? Error opening directory file = '+rec_data+ ' ??'),FBoldBlink);
result := false;
End
Else
Begin
i := 0;
Repeat
Begin
Readln(dirfil,rec_data);
typ_char := UpCase(rec_data[1]);
rec_data := Copy(rec_data,3,Length(rec_data));
Case typ_char of
';' : Begin {comment line, do nothing}
End;
'!' : Begin {comment line, do nothing}
End;
' ' : Begin
End;
'N' : Begin {phone number. bump index and remember #}
i := i + 1;
dir_entry[i].num := rec_data;
End;
'D' : Begin {description of destination/number}
dir_entry[i].desc := rec_data;
End;
'C' : Begin {command passed to DOS upon successful dialing}
dir_entry[i].doscmd := rec_data;
End;
Else Begin {i don't know what to do with this}
Str(i,rec_data);
MsgLine(('?? Bad record type char ('+typ_char+') at rec '+rec_data+' ??'),FBoldBlink);
End;
End;
End;
Until ((Eof(dirfil)) or (i > max_dir_entries));
Close(dirfil);
cur_dir_ent := 1;
If i > max_dir_entries then
Begin
MsgLine('%% Phone dir truncated - increase max_dir_entries. %%',FBoldBlink);
max_dir_ent := i - 1;
End
Else max_dir_ent := i;
End;
ReadDirectory := result;
End; {Function Read_Directory}
Function PickDefault : Integer;
{
This function sees if there is a command tail. If so, see if we can find it in
the descriptions field of the phone directory. If a match, then use that as
the default entry. If not, or no command tail, set default entry to 1.
}
Var
n : integer;
s : string[16];
Begin
PickDefault := 1;
n := Paramcount;
If n > 0 Then
Begin
s := ParamStr(1);
For n := 1 to max_dir_ent Do
If StrMatch(s,dir_entry[n].desc) Then PickDefault := n;
End;
End;
{*************************** Help Routines *******************************}
{
There is a doc file also, but these should help refresh someone's memory.
}
{$I HELP.INC }
{******************** User Entry Selection Routines **************************}
Procedure WriteSelection(num:integer);
{
Write the user's current selection where it's supposed to be. We don't use the
MsgLine routine here because we don't want the delay.
}
Var
x,y : Integer;
tt : Str133;
Begin
ClearVidLine(24);
tt := 'Enter your selection: ' + chr(cur_dir_ent-top_dir_ent+65);
x := length(tt);
y := (80-x) div 2;
FastVideo(tt, FBold, Char_Attrib, x, 24, y);
GotoXY(x+y+1,24);
End;
Procedure Do_PrevLine;
{
Called by getsel to highlight the previous entry line.
}
Var
j : integer;
Begin
j := cur_dir_ent - 1;
If j < top_dir_ent Then
Begin
If j >= 1 Then
Begin
cur_dir_ent := j;
J := IMAX((cur_dir_ent-nls+1),1);
PaintScreen(j,cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
End
Else
Begin
NormalLine(cur_dir_ent);
cur_dir_ent := j;
ReverseLine(cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
End;
Procedure Do_PrevScreen;
{
Called by getsel to paint the previous screen of entries.
}
Begin
If lv1_shft Then
Begin
cur_dir_ent := 1;
PaintScreen(cur_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End
Else
Begin
cur_dir_ent := IMAX((cur_dir_ent-nls),1);
top_dir_ent := IMAX((top_dir_ent-nls),1);
PaintScreen(top_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
End;
Procedure Do_NextLine;
{
Called by getsel to highlight the next entry line.
}
Var
j : integer;
Begin
j := cur_dir_ent + 1;
If j > bot_dir_ent Then
Begin
If j <= max_dir_ent Then
Begin
cur_dir_ent := j;
PaintScreen(cur_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
End
Else
Begin
NormalLine(cur_dir_ent);
cur_dir_ent := j;
ReverseLine(cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
End;
Procedure Do_NextScreen;
{
Called by getsel to paint the next screen of entries.
}
Begin
If lv1_shft Then
Begin
top_dir_ent := max_dir_ent - nls + 1;
If (cur_dir_ent+nls <= max_dir_ent) And
(cur_dir_ent+nls > top_dir_ent)
Then cur_dir_ent := cur_dir_ent + nls
Else cur_dir_ent := top_dir_ent;
PaintScreen(cur_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End
Else
Begin
cur_dir_ent := IMIN((cur_dir_ent+nls),max_dir_ent-nls+1);
top_dir_ent := IMIN((top_dir_ent+nls),max_dir_ent-nls+1);
PaintScreen(top_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
End;
Procedure Push;
{
Here bacause the user used the interrupt key to get a lower shell to type DOS
commands to.
}
Begin
ClrScr;
MsgLine('Pushing to lower shell, type EXIT to return',FNormal);
Execute_Command('');
PaintScreen(cur_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
Function GetSel : Char;
{
Get the user's entry selection.
Uparrow highlight previous entry
Downarrow highlight next entry
Previous screen back up one screen of entries
Shift previous screen Go to top of entry list
Next screen Advance one screen of entries
Shift next screen Go to end of list of entries
Do Use selected entry
Return Use selected entry
Interrupt Push to lower shell
Cancel Hangup the modem
Help Help the user a little
Space Exit
Exit Exit
}
Var
x : Integer;
rc : Integer;
ch : Char;
result : Boolean;
valid_selection : Boolean;
Begin
WriteSelection(cur_dir_ent);
Repeat
Begin
valid_selection := false;
rc := level1key;
ch := UpCase(chr(rc));
case rc of
key_help: Begin
help_user;
DrawBox;
PaintScreen(cur_dir_ent,cur_dir_ent);
WriteSelection(cur_dir_ent);
End;
key_exit: Begin
ch := ' ';
rc := ord(ch);
valid_selection := true;
End;
key_prevscreen: Do_PrevScreen;
Key_nextscreen: Do_NextScreen;
key_downarrow: Do_NextLine;
key_uparrow: Do_PrevLine;
65..83,97..115: Begin
x := bot_dir_ent - top_dir_ent + 65;
If ch <= chr(x) Then
Begin
NormalLine(cur_dir_ent);
cur_dir_ent := ord(ch) - 65 + top_dir_ent;
WriteSelection(cur_dir_ent);
ReverseLine(cur_dir_ent);
End;
End;
Key_Do, 13, 32: valid_selection := true;
Key_Cancel: Result := DisconnectModem;
Key_Interrupt: Push;
Else Write(chr(7));
End;
End;
Until valid_selection;
Getsel := ch;
End;
{******************** Common Modem Service Routines ***************************}
Procedure WrtModemRsp( mrc : integer );
{
Write the modem's response on the information line. This is really modem
independent but is places here for commonality sake for all to use. When you
add your own modem type, please have its return response code routine return
one of the following.
}
Var
rspstr : String[10];
Begin
Str(mrc,rspstr);
ClearVidLine(24);
Case mrc of
-1 : MsgLine('Modem response timeout',FBlink);
0 : MsgLine('Modem responded OK',FBlink);
1 : MsgLine('300 baud Connection',FBlink);
2 : MsgLine('Ring detected',FBlink);
3 : MsgLine('No Connection',FBlink);
4 : MsgLine('Error in Command',FBlink);
5 : MsgLine('1200 baud Connection',FBlink);
6 : MsgLine('2400 baud Connection',FBlink);
Else MsgLine(('Unknown modem response - '+rspstr),FBlink);
End;
End; {Procedure WrtModemRsp}
{************************** Hayes Specific Modem Routines *********************}
{$I HAYES.INC }
{************************** USR Specific Modem Routines ***********************}
{$I USR2400.INC }
{**************************** Modem Indpendent Routines *********************}
{
These are the programs interfact to modem specific routines. The actual work
is done in the Hayes group for instance, but they are not called directly.
}
Function GetModemRsp( secs : Integer ) : Integer;
{
Use this function to get the modem's response for any given command. Response
is returned as an integer value 0 through 5. Call with the maximum number of
seconds you wish to wait.
}
Begin
Case Modem_Type of
1 : GetModemRsp := GetHayesRsp(secs);
2 : GetModemRsp := GetUSR2400rsp(secs);
End;
End;
Function InitModem : Boolean;
{
Initialize the modem. Return false if this failed so top level can abort.
}
Begin
Case Modem_Type of
1 : InitModem := InitHayes;
2 : InitModem := InitUSR2400;
End;
End;
Procedure DialModem;
{
Dial the modem with the user selected string.
}
Begin
Case Modem_Type of
1 : DialHayes;
2 : DialUSR2400;
End;
End;
{****************************** Execute DOS Command Routines ****************}
{$I EXECUTE.INC }
{**************************** Main Program **********************************}
Begin
CrtInit;
ClrScr;
{Introduce ourselves}
texttoprint := version_string;
FastVideo(texttoprint, FBold, Char_Attrib, length(texttoprint), 1, 11);
MsgLine('Use the HELP key for assistence',FBlink);
keepgoing := ReadDirectory;
cur_dir_ent := pickdefault;
top_dir_ent := IMAX((cur_dir_ent-(nls div 2 + 1)),1);
While keepgoing Do
Begin
PaintScreen(top_dir_ent,cur_dir_ent);
If Getsel = ' ' THEN keepgoing := false;
If keepgoing Then
Begin
If InitModem Then
Begin
DialModem;
mcode := GetModemRsp(60);
WrtModemRsp(mcode);
If ((mcode = 1) or (mcode = 5) or (mcode = 6)) THEN
Begin
ClrScr;
For i := 1 to nauto_times Do
dummylogical := WriteCommChar(Chr(autobaud_char));
Case mcode of
6: dummylogical := SetSerial(3,2400,1,DB7S,none,Chr(0));
5: dummylogical := SetSerial(3,1200,1,DB7S,none,Chr(0));
1: dummylogical := SetSerial(3,0300,1,DB7S,none,Chr(0));
end;
commandline := dir_entry[cur_dir_ent].doscmd;
Execute_Command(commandline);
End;
End
Else
Begin
MsgLine('?? Could not initialize your modem ??',FBoldBlink);
keepgoing := false;
End;
End;
End;
Dummylogical := ReplaceDefault;
ClrScr;
CrtExit;
End.