home *** CD-ROM | disk | FTP | other *** search
- Program OffHook;
- {$I Asynch.pas}
- { PtoolWin.Inc}
- VAR
- Command : String [80] Absolute Cseg:$0080;
- Xstring : Array[1..4] of char;
- Error : Boolean;
- k : Char;
- procedure Windowshade(x1,y1,x2,y2:integer);
- var
- i,
- Y : integer;
- begin
-
- TextBackGround(white);
- TextColor(black);
- For Y := y2-1 downto y1 Do
- begin
- Window(x1,y,x2,y2);
- clrscr;
- delay(30);
- end;
-
- GoToXy(1,1); Write('╔');
- for i := 2 to x2-x1 do
- write('═');
- write('╗');
- for i := 2 to y2-y1 do
- begin Gotoxy(1,i);write('║');
- gotoxy(x2-x1+1,i);Write('║');
- end;
- gotoxy(1,y2-y1+1); Write('╚');
- for i := 2 to x2-x1 do
- write('═');
-
- Window(x1+1,y1+1,x2-1,y2-1);
- write('╝');
-
- TextColor(white);
- TextBackGround(black);
- clrscr;
-
- end;
-
-
-
- procedure Wait;
- begin
-
- while not keypressed do
- delay (20);
- read(kbd,K);
- {PTWClose;}
-
- end;
- procedure parseCom;
- var start,
- j,
- i : integer;
- begin
-
- start := 1;
- While Command[start] = ' ' do
- start := start + 1;
-
- j :=1;
- For i := start to start+3 do
- begin
- Xstring[j] := UpCase(Command[i]);
- j := j+1;
- end;
-
- If Xstring = 'COM1' then OpenCom(Com1,b1200,pNone,d8,s1) else
- If Xstring = 'COM2' then OpenCom(Com2,b1200,pNone,d8,s1) else
- Error := True;
-
- end;
- Procedure Instruct;
- Begin
-
-
- Windowshade(5,3,75,23);ClrScr; GoToXy(1,1);
- WriteLn(' Program Offhook. Version 1.1 19 nov 1985');
- Writeln(' Takes Hayes-comaptable modem connected to Com1 or Com2');
- WriteLn(' and sets it off-hook so callers get a busy signal. ');
- WriteLn(' Set which com-port by command line parameters, that is');
- WriteLn(' for Com1, enter: ');
- WriteLn(' OFFHOOK COM1<cr>');
- Writeln(' for Com2, enter: ');
- WriteLn(' OFFHOOK COM2<cr>');
- Writeln(' Send comments or bug reports to The Wizard, ');
- Writeln(' The Wizards Tower, Fido 102/16, (201)-288-9076.');
- WriteLn(' ');
- Writeln(' Press any key to exit.');
- WriteLn(' ');
- wait;
-
- End;
- Procedure ReportError;
- var key : char;
-
- Procedure warble;
- var tone : integer;
- x : real;
- begin
- tone := 8000;
- while tone >199 do
- begin
- sound(tone);
- delay(1);
- x := tone;
- x := x * 0.95;
- tone := trunc(x);
- end;
- nosound;
- end;
- {---------}
- Begin
-
- Windowshade(20,10,60,15); clrscr; GoToXy(1,1);
- Writeln(' OffHook Version 1.1 19 nov 1985');
- WriteLn(' No such port as ',Xstring);
- Write (' Press any key to exit.');
- While not keypressed do
- begin
- Delay(50);
- warble;
- end;
- Read(KBD,key);
-
- End;
- procedure reportOpen;
- begin
-
- WriteCom('AT M0');
- Delay(1500);
- WriteCom('AT H1');
- Delay(1500);
- CloseCom;
- ClrScr; Gotoxy(10,10);
- Windowshade(20,10,60,15); clrscr; Gotoxy(1,1);
- WriteLn (' OffHook Version 1.1, 19 Nov 1985');
- WriteLn (' Port ',Xstring,' set off hook.');
-
- end;
-
- BEGIN
-
- {PTWSET(1,5,2,75,23,-2,3,0);
- PTWSet(2,20,10,60,15,2,0,14);}
-
- Error := False;
-
- If Length(Command) >= 4
- Then Begin
- ParseCom;
- If Error
- Then ReportError
- Else ReportOpen;
- end
- Else Instruct;
-
- END.