Program Converse;



Uses

  LctSupp,

  LctKrnl,

  Dos,

  Crt;



Const {global}

  Nul: string = '';

  Forever:  boolean = false;

{  QuitBuf:  array[1..13] of char = 'QUIT CONVERSE';

}

  Reconnect240: array[1..21] of char = #10 + #13 + 'Reconnect in 240.'

    + #10 + #13;

  LenReconnect240: integer = 21;

  Reconnect15: array[1..20] of char = #10 + #13 + 'Reconnect in 15.'

    + #10 + #13;

  LenReconnect15: integer = 20;

  StrReconnect: string = 'Reconnect in ';

  PeriodEnd: array[1..3] of char = '.' + #10 + #13;

  LenPeriodEnd: integer = 3;

  CentralToAnswererProgram: array[1..48] of char =

    #10 + #13 + 'Address: Central Program to Answerer Program' + #10 + #13;

  LenCentralToAnswererProgram: integer = 48;

  ImBack: array[1..20] of char = #10 + #13 + 'I have returned.' + #10 + #13;

  LenImBack: integer = 20;

  StrImBack: string = 'I have returned.' + #10 + #13;

  YoureBackAck: array[1..16] of char = #10 + #13 + 'So you have.'

    + #10 + #13;

  LenYoureBackAck: integer = 16;

  StrYoureBackAck: string = 'So you have.' + #10 + #13;

  YourDelay: array[1..16] of char = #13 + #10 + 'Your delay is ';

  LenYourDelay: integer = 16;

  StrYourDelay: string = 'Your delay is ';

  YourName: array[1..16] of char = #13 + #10 + 'Your name is #';

  LenYourName: integer = 16;

  StrYourName: string = 'Your name is #';

  StrAns2ToCentral: string =

    'Address: Program Answerer #2 to Program Central';

  AnsToCentral: array[1..48] of char =

    #13 + #10 + 'Address: Program Answerer to Program Central' + #13 + #10;

  LenAnsToCentral: integer = 48;

  StrAnsToCentral: string =

    'Address: Program Answerer to Program Central';

  Address:  string = 'Address:';

  StrAddressYourModem: string = 'Address:  Your modem to you' + #13 + #10;

  LineFeedReturn: string = #10 + #13;

  EndMessage: string = 'End Message.';

  NoCarrier: string = 'NO CARRIER';

  Connect2400: string = 'CONNECT 2400';

  StrConnect: string = 'CONNECT';

  Str2400: string = '2400';

  AnsToDial: array[1..50] of char =

    #13 + #10 + 'Address:  Answering Program to Dialing Program' + #10 + #13;

  LenAnsToDial: integer = 50;

  DialToAns: array[1..50] of char =

    #13 + #10 + 'Address:  Dialing Program to Answering Program' + #10 + #13;

  LenDialToAns: integer = 50;

  Query: array[1..52] of char =

    #10 + #13 + 'Do you want to be Central Dialer or an Answerer?'

    + #10 + #13;

  LenQuery: integer = 52;

  StrQuery: string = 'Dialer or an Answerer?' + #10 + #13;

  YoureCentral: array[1..28] of char =

    #10 + #13 + 'I want to be an Answerer' + #10 + #13;

  LenYoureCentral: integer = 28;

  StrYoureCentral: string = 'I want to be an Answerer' + #10 + #13;

  YoureAnswerer: array[1..24] of char =

    #10 + #13 + 'I want to be Central' + #10 + #13;

  LenYoureAnswerer: integer = 24;

  StrYoureAnswerer: string = 'I want to be Central' + #10 + #13;

  DisAndWait: array[1..55] of char =

    #10 + #13 + 'I''ll call you back.  Disconnect and wait to answer.'

    + #10 + #13;

  LenDisAndWait: integer = 55;

  StrDisAndWait: string = 'wait to answer.' + #10 + #13;

  Sixty: string = 'is #';



Type {global}

  BuffChar160 = array[1..160] of char;

  BuffChar7 = array[1..7] of char;

  BuffChar255 = array[1..255] of char;



Var {global}

  Dummy: integer;

  DummyChar: char;

  DumBool: boolean;

  DumStr: string;

  Result: integer;

  ResultBool: boolean;

  OutBuf:  array[1..78] of char;

  BufIndex:  integer;

  InX, InY: integer;

  WhereMode: integer;

  Disconnected:  boolean;

  Hour, Minute, Second, Sec100:  word;

  Buff: BuffChar255;

  NumChars: integer;

  ImCentral: boolean;

  AnswererDelay: longint;

  AddressYourModem: boolean;

  AnswererName: integer;



  testing: longint;

  Found1, Found2: boolean;

  DoDelay: boolean;  {used in CheckIncoming, modified by SendPlusses}

  DialAnotherbool: boolean;



procedure PoliteWait;

{***************************************************************************}

begin

  writeln;

  writeln('Please press ENTER to continue...');

  readln;

end;



Procedure ClrInterfaceLine;

{***************************************************************************}

begin

  window(1,22,80,23);

  clrscr;

end;



Procedure DisplayScreen;

{***************************************************************************}

begin

  clrscr;

  writeln('CONVERSE is a program which allows several interconnected modems');

  writeln('to send messages to each other.  You must be using');

  writeln('communications port 2 and a modem capable of 2400 baud.');

  writeln('ESC will initialize the modem.');

  writeln('CNTRL-ENTER will disconnect.');

  writeln('CNTRL-BREAK will quit.');

  writeln('QUIT CONVERSE to quit neatly.');

  writeln('C1C David W. Croft, CL90, CS-36');

  PoliteWait;

end;



Procedure ChangeDisplay;

{***************************************************************************}

begin

  ClrInterfaceLine;

  if WhereMode = 0 then

    writeln('Outgoing message to where:  1) Program 2) Modem 3) Phone Line');

  if WhereMode = 1 then

    writeln('Message to your program:  1) Quit 2) Dial 3) Wait for call');

  if WhereMode = 2 then

    writeln(

    'Message to your modem:  ESC to initialize, CNTRL-ENTER to disconnect.');

  if WhereMode = 3 then

    writeln('Message to the phone line:  type it out');

end;





Procedure SetUpCommPort;

{***************************************************************************}

var

  ResultBool:  boolean;

begin

  ResultBool := CommOpen(2, 2400, 'N', 8, 1, 256, 256, false);

  if not(ResultBool) then

    begin

      writeln('Communications port failed to open!!!');

      PoliteWait;

      halt;

    end;

end;





Procedure DisplayIncoming;

{***************************************************************************}

var

  alpha: integer;

begin

      window(1, 2, 80, 18);

      for alpha := 1 to NumChars do

        begin

          gotoXY(InX, InY);

          write(Buff[alpha]);

          if WhereY > 18 then

            begin

              InX := WhereX;

              InY := WhereY;

              GotoXY(1,1);

              DelLine;

              GotoXY(InX, InY - 1);

            end;

          InX := WhereX;

          InY := WhereY;

        end;

end;



Function CheckBuffForSpecific(var CheckString: string): integer;

{***************************************************************************}

{* Returns an integer value of zero if not found.

{* Otherwise, returns the starting location in the Buffer.

{***************************************************************************}

var

  alpha, bravo: integer;

  CheckBuff: BuffChar255;

  CompareBuff: BuffChar255;

  WhereFound: integer;

  Found: boolean;

begin

  WhereFound := 0;

  if NumChars >= length(CheckString) then

    for alpha := 1 to NumChars - length(CheckString) + 1 do

      begin

        Found := true;

        for bravo := 1 to length(CheckString) do

          if Buff[alpha + bravo - 1] <> CheckString[bravo] then

            Found := false;

        if Found then

          begin

            WhereFound := alpha;

            alpha := NumChars - length(CheckString) + 1; {exit loop}

          end;

      end;

  CheckBuffForSpecific := WhereFound;

end;



Procedure AddBuff(AddedString: string);

{***************************************************************************}

{* Modifies global variable NumChars.

{***************************************************************************}

var

  alpha: integer;

begin

  for alpha := NumChars + 1 to NumChars + length(AddedString) do

    Buff[alpha] := AddedString[alpha - NumChars];

  NumChars := NumChars + length(AddedString);

end;



Procedure ShiftBuffLeftOne;

{***************************************************************************}

var

  alpha: integer;

  TempNumChars: integer;

  TempBuff: BuffChar255;

begin

  TempNumChars := NumChars;

  NumChars := 1;

  DisplayIncoming;

  NumChars := TempNumChars - 1;

  for alpha := 2 to 255 do

  TempBuff[alpha - 1] := Buff[alpha];

  for alpha := 1 to 254 do

    Buff[alpha] := TempBuff[alpha];

end;



Procedure CheckIncoming(SearchString1: string; var Found1: boolean;

                        SearchString2: string; var Found2: boolean);

{***************************************************************************}

var

  alpha: integer;

  InByte: byte;

begin

  Found1 := false;

  Found2 := false;

  NumChars := 0;

  repeat

    ResultBool := LctGet(2, InByte);

    if (NumChars > 0) and not(ResultBool) and DoDelay then

      begin

        delay(50);

        ResultBool := LctGet(2, InByte);

      end;

    if ResultBool then

      begin

        NumChars := NumChars + 1;

        if  NumChars > 255 then

          ShiftBuffLeftOne;

        Buff[NumChars] := char(InByte);

        if CheckBuffForSpecific(SearchString1) > 0 then

          Found1 := true;

        if CheckBuffForSpecific(SearchString2) > 0 then

          Found2 := true;

        if (not(AddressYourModem)) and

          (CheckBuffForSpecific(EndMessage) > 0) then

            begin

              AddressYourModem := true;

              AddBuff(LineFeedReturn);

              AddBuff(StrAddressYourModem);

              DisplayIncoming;

              NumChars := 0;

            end

        else

          if (AddressYourModem)

            and (CheckBuffForSpecific(Address) > 0)

              then

                begin

                  AddressYourModem := false;

                  NumChars := NumChars - length(Address);

                  DisplayIncoming;

                  NumChars := 0;

                  AddBuff(LineFeedReturn);

                  AddBuff(Address);

                  DisplayIncoming;

                  NumChars := 0;

                end;

      end;

    if SearchString1 = Nul then

      Found1 := false;

    if SearchString2 = Nul then

      Found2 := false;

  until not(ResultBool) or Found1 or Found2;

  if NumChars > 0 then

    begin

      DisplayIncoming;

      NumChars := 0;

    end;

end;



Procedure SendPlussesSub;

{***************************************************************************}

const

  plus: char = '+';

  ATX1: array[1..6] of char = 'ATX1' + #10 + #13;

  StrOK: string = 'OK';

var

  alpha:  integer;

  bravo: integer;

  CharK: byte;

begin

  ClrInterfaceLine;

  write('Sending disconnection plusses.');

  Disconnected := true;

  for alpha := 1 to 3 do

    begin

      Result := PutStream(2, plus, 1);

      Delay(500);

    end;

  Delay(1000);

end;



Procedure SendPlussesBaud;

{***************************************************************************}

const

  ConstO: byte = ord('O');

var

  CharK: byte;

  alpha: integer;

begin

          ClrInterfaceLine;

          write('Trying to disconnect a bad baud rate!!!  ');

          writeln('Trying to disconnect at 0110 baud.');

          DumBool := CommSetup(2, 110, 'N', 8, 1);

          SendPlussesSub;

          ClrInterfaceLine;

          writeln('Trying to disconnect at 0300 baud.');

          DumBool :=CommSetup(2, 300, 'N', 8, 1);

          SendPlussesSub;

          ClrInterfaceLine;

          writeln('Trying to disconnect at 1200 baud.');

          DumBool := CommSetup(2, 1200, 'N', 8, 1);

          SendPlussesSub;

          ClrInterfaceLine;

          writeln('Trying to disconnect at 2400 baud.');

          DumBool := CommSetup(2, 2400, 'N', 8, 1);

          SendPlussesSub;

end;



Procedure SendPlusses;

{***************************************************************************}

const

  ATH0: array[1..6] of char = 'ATH0' + #10 + #13;

var

  Inchar: byte;

  alpha: integer;

begin

  alpha := 0;

  repeat

    alpha := alpha + 1;

    if alpha > 2 then

      SendPlussesBaud;

    SendPlussesSub;

    Dummy := PutStream(2, ATH0, 6);

    Delay(2000);

    FlushUntilMatch(2,ord('O'));

    DumBool := LctPeek(2, InChar);

    if char(InChar) = 'K' then

      Found1 := true

    else

      Found1 := false;

    if Found1 then

      begin

        ClrInterfaceLine;

        writeln('  Disconnection successful.');

      end;

  until Found1;

end;



Function Connected2400: boolean;

{***************************************************************************}

const

  True2400: array[0..4] of char = ' 2400';

var

  alpha, bravo: integer;

  Buff2400: array[0..4] of char;

  InChar: byte;

  Connected2400Temp: boolean;

begin

  alpha := -1;

  bravo := 0;

  repeat

    bravo := bravo + 1;

    if BytesInInput(2) > 0 then

      begin

        alpha := alpha + 1;

        DumBool := LctGet(2, InChar);

        Buff2400[alpha] := char(InChar);

      end;

   until (alpha = 4) or (bravo > 5000);

   if alpha = 4 then

     begin

       if Buff2400 = True2400 then

         Connected2400Temp := true

       else

         Connected2400Temp := false;

     end

   else

     Connected2400Temp := false;

  if not(Connected2400Temp) then

    begin

      ClrInterfaceLine;

      write('   Connected at the wrong baud rate!!!');

      SendPlussesBaud;

    end

  else

    write(' 2400');

  Connected2400 := Connected2400Temp;

end;





Procedure InitializeModem;

{***************************************************************************}

const

  InitBuf: array [1..6, 1..20] of char = (

                                     'ATQ0               ' + #13,

                                     'AT&M0              ' + #13,

                                     'AT&D0              ' + #13,

                                     'ATF0               ' + #13,

                                     'ATX1               ' + #13,

                                     'ATS10=255          ' + #13

                                     );

var

  alpha, bravo: integer;

begin

  for alpha := 1 to 6 do

    begin

      Result := PutStream(2, InitBuf[alpha], 20);

      for bravo := 1 to 12000 do

        CheckIncoming(Nul, DumBool, Nul, DumBool);

    end;

  WhereMode := 0;

  ChangeDisplay;

end;



Procedure HangUp;

{***************************************************************************}

const

  LenATH0: integer = 5;

  ATH0: array[1..5] of char = 'ATH0' + #13;

begin

  if not(Disconnected) then

    SendPlusses;

  Result := PutStream(2, ATH0, LenATH0);

  Delay(2000);

end;



Procedure ConnectLine;

{***************************************************************************}

const

  ATH0: array[1..6] of char = 'ATH0' + #13 +#10;

  ConnectBuf:  array[1..5] of char = 'ATA' + #13 +#10;

var

  alpha: longint;

begin

repeat

  Result := PutStream(2, ATH0, 6);

  for alpha := 0 to 20000 do

    CheckIncoming(Nul, DumBool,Nul,DumBool);

  ClrInterfaceLine;

  writeln('I''m going to reconnect to Central now.');

  for alpha := 0 to 5000 do

    CheckIncoming(Nul,DumBool,Nul,DumBool);

  Result := PutStream(2, ConnectBuf, 5);

  alpha := 0;

  repeat

    alpha := alpha + 1;

    CheckIncoming(StrConnect, Found1, Nul, DumBool);

  until Found1 or (alpha > 80000);

  if not(Found1) then

    begin

      SendPlusses;

      HangUp;

      Delay(3000);

      Found1 := false;

    end;

  if Found1 and not(Connected2400) then

    begin

      ClrInterfaceLine;

      write('Must reattempt.  Connected at a bad baud.');

      Found1 := false;

    end;

until Found1;

  Disconnected := false;

  Delay(4000);

end;



Procedure TypeOutMessage(OutKey:  char);

{***************************************************************************}

var

  alpha: integer;

begin

  Inc(BufIndex);

  if (OutKey = #13) and (BufIndex < 78) then

    begin

      OutBuf[BufIndex] := #10;

      BufIndex := BufIndex + 1;

      OutBuf[BufIndex] := #13;

      Result := PutStream(2, OutBuf, BufIndex);

      if Result = 0 then

        begin

          writeln('Error in transmission!');

          PoliteWait;

          halt;

        end;

      BufIndex := 0;

      WhereMode := 0;

      ChangeDisplay;

    end

  else

    if (BufIndex = 78) and (OutKey <> #13) then

      begin

        write(#7);

        BufIndex := 77;

      end

    else

      if OutKey = #8 then

        begin

          if BufIndex <2 then

            write(#7)

           else

             BufIndex := BufIndex - 2;

         end

       else

         OutBuf[BufIndex] := OutKey;

  winUnit CommSoft; {the FalcoNet version}



Interface

{***************************************************************************}

{***************************************************************************}

Uses

  Crt,

  LctKrnl;



Procedure IntroComm;

Procedure ClosePortComm;

Procedure OutComm(Sender: string; Destination: string; Message: string);

Procedure InComm(var IncomingMessage: string);



Implementation

{***************************************************************************}

{***************************************************************************}



Procedure IntroComm;

{***************************************************************************}

var

  option: char;

begin

  TextBackground(Black);

  TextColor(Red);

  clrscr;

  write('This portion of the program was written by C1C David W. Croft, ');

    writeln('Class of ''90.');

  writeln('It handles the Net communications interface.');

  writeln('It was created using Turbo Pascal 5.5 and LiteComm.');

  writeln;

  writeln('Before you can use this program you need to have loaded up');

  writeln('the Net and gotten onto the e-mail menu where it says,');

  writeln('"Read, Create, Select," etc.  You then must hit Alt-F10-X which');

  writeln('will break you out of the Net program but not disconnect your');

  writeln('Nid from user services.  Then this program can take over.');

  writeln;

  writeln('If you have not done this, please enter "Q" now.  You can');

  writeln('start this program over after you have done so.');

  writeln('If you have done so, then please just hit ENTER.');

  option := readkey;

  if upcase(option) = 'Q' then

    halt;

end;



Procedure ClosePortComm;

{***************************************************************************}

begin

  CommClose(2, true);

end;



Procedure OutComm(Sender: string; Destination: string; Message: string);

{***************************************************************************}

type

  StrBuff = array[1..255] of char;

const

  LenHeaderBuff = 0;

  HeaderBuff: array[0..LenHeaderBuff] of char = ' ';

  LenTrailerBuff = 0;

  TrailerBuff: array[0..LenTrailerBuff] of char = ' ';

var

  MessageBuff: StrBuff;

begin

  LenMessageBuff := length(Message);

  for alpha := 1 to LenMessageBuff do

    MessageBuff[alpha] := Message[alpha];

  DumInt := PutStream(2, HeaderBuff, LenHeaderBuff);

  DumInt := PutStream(2, MessageBuff, LenMessageBuff);

  DumInt := PutStream(2, TrailerBuff, LenTrailerBuff);

end;



Procedure InComm(var IncomingMessage: string);

{***************************************************************************}

var

  LengthBuff: integer;

  alpha: integer;

begin

  LengthBuff := GetStream(2, IncomingBuff, 255);

  IncomingMessage[0] := LengthBuff;

  for alpha := 1 to LengthBuff do

    IncomingMessage[alpha] := IncomingBuff[alpha];

end;



{* Main Program *}

{***************************************************************************}

{***************************************************************************}

var

  DumBool: boolean;

begin

  DumBool := CommOpen(2, 9600, 'N', 8, 1, 1000, 1000, true);

end.  .  °—          Ì  ¶WZ  "        VÕ ðå  Ù  Tõæ  ö o    Ò  7    (         z      ¿    YLCTKRNL  š>Õ ç   YSYSTEM  aéç     YDOS  ñ  Õ   PPORTMASKæ ß      PDTRæ ß      PRTSæ ß      PXONæ ß      PXOFFæ ß      POVERRUNæ ß      P	BADPARITYæ ß    GPBADFRAMEæ ß      PBREAKDETæ ß      PDELTACTSæ ß      PDELTADSRæ ß      PDELTARIæ ß      PDELTADCDæ ß    
PCTSæ ß      PDSRæ ß ÆFüë<MuÆFü(ë
<SuÆFü8ëé7‹F= u
ŠFü ˆFüë0= u
ŠFüˆFüë!= u
ŠFüˆFüë= u
ŠFüˆFüëéõ ƒ~u
ŠFü ˆFüëƒ~u
ŠFüˆFüëéÒ úä!ˆF÷ŠF÷Ä~ø&
Eæ!Ä~ø‰~òŒFôÄ~ò&‹E@‹Ð° îÄ~ò&‹E@‹Ð° îÄ~ò&‹E ‹Ð°€îÄ~ò&‹E  ‹ÐŠFýîÄ~ò&‹E@‹ÐŠFþîÄ~ò&‹E ‹ÐŠFüîÄ~ò&‹E ‹ÐÄ~ò&ŠE
îÄ~ò&‹E@‹ÐÄ~ò&ŠEîÄ~ò&‹E@‹ÐÄ~ò&ŠEîä!ˆF÷ŠF÷Ä~ò&ˆEÄ~ò&ŠEöÐˆFöŠF÷"Föæ!ûÆFÿŠFÿ‰ì]Ê
 U‰åƒìÆFÿ ƒ~|ƒ~~é³š¸¿ƒú |=D séŸ¸D Pš¿‰Fû‰Vý‹F= u!ÇFùø‹FùÄ~û&‰EÄ~û&ÆEÄ~û&ÆEëz= u!ÇFùø‹FùÄ~û&‰EÄ~û&ÆEÄ~û&ÆEëT= u&¡ ‰Fù‹FùÄ~û&‰E  dow(1,23,80,23);

  clrscr;

  for alpha := 1 to BufIndex do

    write(OutBuf[alpha]);

end;



Procedure UpdateTime;

{***************************************************************************}

var

  NewSecond: word;

begin

  GetTime(Hour, Minute, NewSecond, Sec100);

  if NewSecond <> Second then

    begin

      Second := NewSecond;

      window(1,21,80,22);

      write(hour:2,':',minute:2,':',second:2);

    end;

end;



Procedure ClrTimeLine;

{***************************************************************************}

begin

  UpdateTime;

  writeln('                                                            ',

  '                        ');

  UpdateTime;

end;





Procedure Dial;

{***************************************************************************}

const

  ATD: array[1..3] of char = 'ATD';

var

  OutKey: char;

  Found1, Found2: boolean;

  alpha: integer;

begin

  repeat

    ClrInterfaceLine;

    writeln('What is the number of the modem which you wish to dial?');

    if not(Disconnected) then

      HangUp;

    Disconnected := true;

    Result := PutStream(2, ATD, 3);

    repeat

      UpdateTime;

      CheckIncoming(Nul, DumBool, Nul, DumBool);

      If KeyPressed then

        begin

          OutKey := readkey;

          TypeOutMessage(OutKey);

        end;

    until OutKey = #13;

    window(1,22,80,23);

    clrscr;

    write('Press any key to stop waiting for an answer.');

    repeat

      UpdateTime;

      CheckIncoming(StrConnect, Found1, NoCarrier, Found2);

    until KeyPressed or Found1 or Found2;

    if Found1 and not(Connected2400) then

      begin

        ClrInterfaceLine;

        writeln('Must reattempt.  Connected at the wrong baud rate.');

        Found1 := false;

      end;

    if Found1 then

      begin

        AddBuff(LineFeedReturn);

        DisplayIncoming;

        UpdateTime;

        ClrInterfaceLine;

        write('   Converse Mode:  Connected.');

        Disconnected := false;

      end;

    if KeyPressed then

      begin

        dummychar := readkey;

        HangUp;

      end;

  until KeyPressed or Found1;

end;





Procedure DialLoop;

{***************************************************************************}

const

  ATD: array[1..5] of char = 'ATD' + #13 + #10;

  ATH0: array[1..6] of char = 'ATH0' + #13 + #10;

  ATS10:  array[1..11] of char = 'ATS10=255' + #13 + #10;

  LenATS10:  integer = 11;

var

  OutKey: char;

  Found1, Found2: boolean;

  alpha, bravo: longint;

begin

  repeat

  if not(Disconnected) then

    SendPlusses;

  Disconnected := true;

  Delay(2000);

  Result := PutStream(2, ATH0, 6);

  Delay(2000);

  Result := PutStream(2, ATS10, LenATS10);

  Delay(2000);

  Result := PutStream(2, ATD, 5);

  alpha := 0;

  repeat

    alpha := alpha + 1;

    if alpha = 40000 then

      begin

        SendPlusses;

        Result := PutStream(2, ATH0, 6);

        for bravo := 1 to 5000 do

          checkincoming(Nul, DumBool, Nul, DumBool);

        Result := PutStream(2, ATD, 5);

        alpha := 0;

      end;

    UpdateTime;

    CheckIncoming(StrConnect, Found1, NoCarrier, Found2);

    if Found1 and not(Connected2400) then

      begin

        ClrInterfaceLine;

        writeln('Must reattempt because I connected at the wrong baud.');

        Found1 := false;

      end;

  until KeyPressed or Found1 or Found2;

  if Found1 then

    begin

      AddBuff(LineFeedReturn);

      DisplayIncoming;

      UpdateTime;

      ClrInterfaceLine;

      write('  Converse Mode:  Connected.');

      Disconnected := false;

    end

  else  {NoCarrier}

    begin

      if KeyPressed then

        dummychar := readkey;

      HangUp;

    end;

  until Found1;

end;



Procedure AddSecs(SecsAdded: integer);

{***************************************************************************}

begin

  Second := Second + SecsAdded;

  if Second > 59 then

    begin

      Second := Second - 60;

      Minute := Minute + 1;

    end;

  if Minute > 59 then

    begin

      Minute := Minute - 60;

      Hour :=Unit CommSoft; {the FalcoNet version}



Interface

{***************************************************************************}

{***************************************************************************}

Uses

  Crt,

  LctKrnl;



Procedure IntroComm;

Procedure ClosePortComm;

Procedure OutComm(Sender: string; Destination: string; Message: string);

Procedure InComm(var IncomingMessage: string);



Implementation

{***************************************************************************}

{***************************************************************************}



Procedure IntroComm;

{***************************************************************************}

var

  option: char;

begin

  TextBackground(Black);

  TextColor(Red);

  clrscr;

  write('This portion of the program was written by C1C David W. Croft, ');

    writeln('Class of ''90.');

  writeln('It handles the Net communications interface.');

  writeln('It was created using Turbo Pascal 5.5 and LiteComm.');

  writeln;

  writeln('Before you can use this program you need to have loaded up');

  writeln('the Net and gotten onto the e-mail menu where it says,');

  writeln('"Read, Create, Select," etc.  You then must hit Alt-F10-X which');

  writeln('will break you out of the Net program but not disconnect your');

  writeln('Nid from user services.  Then this program can take over.');

  writeln;

  writeln('If you have not done this, please enter "Q" now.  You can');

  writeln('start this program over after you have done so.');

  writeln('If you have done so, then please just hit ENTER.');

  option := readkey;

  if upcase(option) = 'Q' then

    halt;

end;



Procedure ClosePortComm;

{***************************************************************************}

begin

  CommClose(2, true);

end;



Procedure OutComm(Sender: string; Destination: string; Message: string);

{***************************************************************************}

type

  StrBuff = array[1..255] of char;

const

  LenHeaderBuff = 0;

  HeaderBuff: array[0..LenHeaderBuff] of char = ' ';

  LenTrailerBuff = 0;

  TrailerBuff: array[0..LenTrailerBuff] of char = ' ';

var

  MessageBuff: StrBuff;

  LenMessageBuff: integer;

begin

  LenMessageBuff := length(Message);

  for alpha := 1 to LenMessageBuff do

    MessageBuff[alpha] := Message[alpha];

  DumInt := PutStream(2, HeaderBuff, LenHeaderBuff);

  DumInt := PutStream(2, MessageBuff, LenMessageBuff);

  DumInt := PutStream(2, TrailerBuff, LenTrailerBuff);

end;



Procedure InComm(var IncomingMessage: string);

{***************************************************************************}

var

  LengthBuff: integer;

  alpha: integer;

begin

  LengthBuff := GetStream(2, IncomingBuff, 255);

  IncomingMessage[0] := LengthBuff;

  for alpha := 1 to LengthBuff do

    IncomingMessage[alpha] := IncomingBuff[alpha];

end;



{* Main Program *}

{***************************************************************************}

{***************************************************************************}

var

  DumBool: boolean;

begin

  DumBool := CommOpen(2, 9600, 'N', 8, 1, 1000, 1000, true);

end. ¶WZ  "        VÕ ðå  Ù  Tõæ  ö o    Ò  7    (         z      ¿    YLCTKRNL  š>Õ ç   YSYSTEM  aéç     YDOS  ñ  Õ   PPORTMASKæ ß      PDTRæ ß      PRTSæ ß      PXONæ ß      PXOFFæ ß      POVERRUNæ ß      P	BADPARITYæ ß    GPBADFRAMEæ ß      PBREAKDETæ ß      PDELTACTSæ ß      PDELTADSRæ ß      PDELTARIæ ß      PDELTADCDæ ß    
PCTSæ ß      PDSRæ ß ‹÷&Š<t!<t,<
t5<
t9GþÂ:Bv<èo è ÿŠ@ë,èc QR¸èÃ ZYëèT :@tþÊëèG èxÿëè? Š@G‹÷‹Úâ¦è1 ¸@ ŽØ‰P ŠÆö&J 2öÂ‹È‹c °îë ŠÅBîë J°îë ŠÁBîÃ;÷tcQRW‹Ï+ÎŠ;Š6>¸@ ŽØŠÇö&J 2ÿÃÑà‹ø‹Ú‹c ƒÂ¸ ¸€>I u´°ŽÀü
Ût¬ŠØì¨uûúì¨tû‹Ã«ûâìëŠç¬«âü_ZYÃVWUÍ]_^Ã             º¸ŽÚŒ< 3í‹Ä ±ÓèŒÒÂ£ £  £ £" £& &¡ - £* ¿L¾Ý¹ ü.¬´5Í!‰ŒEƒÇâðºÎ ¸ %Í!ºÕ ¸#%Í!º ¸$%Í!ºÆ ¸?%Í!¸LPP¸Pè
èm
¸LPP¸Pèí	è^
ËûƒÄXƒçÇ– €ü9s¿ÿÿW´TÍ!‹ì€NX[YZ^_]Ï¸Ð ƒÄë¸È Y[ë¸ÿ 3É3Ûº¸ŽÚû£6 ‹ÁÃt¡ ÀUnit CommSoft; {the FalcoNet version}



Interface

{***************************************************************************}

{***************************************************************************}

Uses

  Crt,

  LctKrnl;



Procedure IntroComm;

Procedure ClosePortComm;

Procedure OutComm(Sender: string; Destination: string; Message: string);

Procedure InComm(var IncomingMessage: string);



Implementation

{***************************************************************************}

{***************************************************************************}



Procedure IntroComm;

{***************************************************************************}

var

  option: char;

begin

  TextBackground(Black);

  TextColor(Red);

  clrscr;

  write('This portion of the program was written by C1C David W. Croft, ');

    writeln('Class of ''90.');

  writeln('It handles the Net communications interface.');

  writeln('It was created using Turbo Pascal 5.5 and LiteComm.');

  writeln;

  writeln('Before you can use this program you need to have loaded up');

  writeln('the Net and gotten onto the e-mail menu where it says,');

  writeln('"Read, Create, Select," etc.  You then must hit Alt-F10-X which');

  writeln('will break you out of the Net program but not disconnect your');

  writeln('Nid from user services.  Then this program can take over.');

  writeln;

  writeln('If you have not done this, please enter "Q" now.  You can');

  writeln('start this program over after you have done so.');

  writeln('If you have done so, then please just hit ENTER.');

  option := readkey;

  if upcase(option) = 'Q' then

    halt;

end;



Procedure ClosePortComm;

{***************************************************************************}

begin

  CommClose(2, true);

end;



Procedure OutComm(Sender: string; Destination: string; Message: string);

{***************************************************************************}

type

  StrBuff = array[1..255] of char;

const

  LenHeaderBuff = 0;

  HeaderBuff: array[0..LenHeaderBuff] of char = ' ';

  LenTrailerBuff = 0;

  TrailerBuff: array[0..LenTrailerBuff] of char = ' ';

var

  MessageBuff: StrBuff;

  LenMessageBuff: integer;

  alpha: integer;

begin

  LenMessageBuff := length(Message);

  for alpha := 1 to LenMessageBuff do

    MessageBuff[alpha] := Message[alpha];

  DumInt := PutStream(2, HeaderBuff, LenHeaderBuff);

  DumInt := PutStream(2, MessageBuff, LenMessageBuff);

  DumInt := PutStream(2, TrailerBuff, LenTrailerBuff);

end;



Procedure InComm(var IncomingMessage: string);

{***************************************************************************}

var

  LengthBuff: integer;

  alpha: integer;

begin

  LengthBuff := GetStream(2, IncomingBuff, 255);

  IncomingMessage[0] := LengthBuff;

  for alpha := 1 to LengthBuff do

    IncomingMessage[alpha] := IncomingBuff[alpha];

end;



{* Main Program *}

{***************************************************************************}

{***************************************************************************}

var

  DumBool: boolean;

begin

  DumBool := CommOpen(2, 9600, 'N', 8, 1, 1000, 1000, true);

end.VÕ ðå  Ù  Tõæ  ö o    Ò  7    (         z      ¿    YLCTKRNL  š>Õ ç   YSYSTEM  aéç     YDOS  ñ  Õ   PPORTMASKæ ß      PDTRæ ß      PRTSæ ß      PXONæ ß      PXOFFæ ß      POVERRUNæ ß      P	BADPARITYæ ß    GPBADFRAMEæ ß      PBREAKDETæ ß      PDELTACTSæ ß      PDELTADSRæ ß      PDELTARIæ ß      PDELTADCDæ ß    
PCTSæ ß      PDSRæ ß < wCëòè-þ< vCƒþ tóˆBàFëí_&‰]‹Îã~àèÐúrã
Ç@ j 3À‹Ð‹å]ËU‹ìƒì ‹F‹V
~àè0úÄ~Wèùýu‹F+Á~
‹ñ‹È° èþâù‹Îvàü6¬èþýâø_&‰]‹å]Ê ‹Ü6ŠG<ar<zw, Ê          èè                                                                   âü_ZYÃVWUÍ]_^Ã             º¸ŽÚŒ< 3í‹Ä ±ÓèŒÒÂ£ £  £ £" £& &¡ - £* ¿L¾Ý¹ ü.¬´5Í!‰ŒEƒÇâðºÎ ¸ %Í!ºÕ ¸#%Í!º ¸$%Í!ºÆ ¸?%Í!¸LPP¸Pè
èm
¸LPP¸Pèí	è^
ËûƒÄXƒçÇ– €ü9s¿ÿÿW´TÍ!‹ì€NX[YZ^_]Ï¸Ð ƒÄë¸È Y[ë¸ÿ 3É3Ûº¸ŽÚû£6 ‹ÁÃt¡ ÀUnit CommSoft; {the FalcoNet version}



Interface

{***************************************************************************}

{***************************************************************************}

Uses

  Crt,

  LctKrnl;



Procedure IntroComm;

Procedure ClosePortComm;

Procedure OutComm(Sender: string; Destination: string; Message: string);

Procedure InComm(var IncomingMessage: string);



Implementation

{***************************************************************************}

{***************************************************************************}



Procedure IntroComm;

{***************************************************************************}

var

  option: char;

begin

  TextBackground(Black);

  TextColor(Red);

  clrscr;

  write('This portion of the program was written by C1C David W. Croft, ');

    writeln('Class of ''90.');

  writeln('It handles the Net communications interface.');

  writeln('It was created using Turbo Pascal 5.5 and LiteComm.');

  writeln;

  writeln('Before you can use this program you need to have loaded up');

  writeln('the Net and gotten onto the e-mail menu where it says,');

  writeln('"Read, Create, Select," etc.  You then must hit Alt-F10-X which');

  writeln('will break you out of the Net program but not disconnect your');

  writeln('Nid from user services.  Then this program can take over.');

  writeln;

  writeln('If you have not done this, please enter "Q" now.  You can');

  writeln('start this program over after you have done so.');

  writeln('If you have done so, then please just hit ENTER.');

  option := readkey;

  if upcase(option) = 'Q' then

    halt;

end;



Procedure ClosePortComm;

{***************************************************************************}

begin

  CommClose(2, true);

end;



Procedure OutComm(Sender: string; Destination: string; Message: string);

{***************************************************************************}

type

  StrBuff = array[1..255] of char;

const

  LenHeaderBuff = 0;

  HeaderBuff: array[0..LenHeaderBuff] of char = ' ';

  LenTrailerBuff = 0;

  TrailerBuff: array[0..LenTrailerBuff] of char = ' ';

var

  MessageBuff: StrBuff;

  LenMessageBuff: integer;

  alpha: integer;

begin

  LenMessageBuff := length(Message);

  for alpha := 1 to LenMessageBuff do

    MessageBuff[alpha] := Message[alpha];

  DumInt := PutStream(2, HeaderBuff, LenHeaderBuff);

  DumInt := PutStream(2, MessageBuff, LenMessageBuff);

  DumInt := PutStream(2, TrailerBuff, LenTrailerBuff);

end;



Procedure InComm(var IncomingMessage: string);

{***************************************************************************}

var

  LengthBuff: integer;

  alpha: integer;

begin

  LengthBuff := GetStream(2, IncomingBuff, 255);

  IncomingMessage[0] := LengthBuff;

  for alpha := 1 to LengthBuff do

    IncomingMessage[alpha] := IncomingBuff[alpha];

end;



{* Main Program *}

{***************************************************************************}

{***************************************************************************}

var

  DumBool: boolean;

  DumInt: integer;

begin

  DumBool := CommOpen(2, 9600, 'N', 8, 1, 1000, 1000, true);

end.  ö o    Ò  7    (         z      ¿    YLCTKRNL  š>Õ ç   YSYSTEM  aéç     YDOS  ñ  Õ   PPORTMASKæ ß      PDTRæ ß      PRTSæ ß      PXONæ ß      PXOFFæ ß      POVERRUNæ ß      P	BADPARITYæ ß    GPBADFRAMEæ ß      PBREAKDETæ ß      PDELTACTSæ ß      PDELTADSRæ ß      PDELTARIæ ß      PDELTADCDæ ß    
PCTSæ ß      PDSRæ ß ).

                                          



















































                                                                    Croft 9





                 In procedure AmplitudeFilter of program OptiPro, the



            sampled planes are represented by grid matrices.  The



            filtering is accomplished by multiplying the elements of the



            filter matrix, either unity or zero, with the elements of



            the Fourier transform matrix. Unit CommSoft; {the FalcoNet version}



Interface

{***************************************************************************}

{***************************************************************************}

Uses

  Crt,

  LctSupp,

  LctKrnl;



Procedure IntroComm;

Procedure ClosePortComm;

Procedure OutComm(Sender: string; Destination: string; Message: string);

Procedure InComm(var IncomingMessage: string);



Implementation

{***************************************************************************}

{***************************************************************************}

var

  DumBool: boolean;

  DumInt: integer;



Procedure IntroComm;

{***************************************************************************}

var

  option: char;

begin

  TextBackground(Black);

  TextColor(Red);

  clrscr;

  write('This portion of the program was written by C1C David W. Croft, ');

    writeln('Class of ''90.');

  writeln('It handles the Net communications interface.');

  writeln('It was created using Turbo Pascal 5.5 and LiteComm.');

  writeln;

  writeln('Before you can use this program you need to have loaded up');

  writeln('the Net and gotten onto the e-mail menu where it says,');

  writeln('"Read, Create, Select," etc.  You then must hit Alt-F10-X which');

  writeln('will break you out of the Net program but not disconnect your');

  writeln('Nid from user services.  Then this program can take over.');

  writeln;

  writeln('If you have not done this, please enter "Q" now.  You can');

  writeln('start this program over after you have done so.');

  writeln('If you have done so, then please just hit ENTER.');

  option := readkey;

  if upcase(option) = 'Q' then

    halt;

end;



Procedure ClosePortComm;

{***************************************************************************}

begin

  CommClose(2, true);

end;



Procedure OutComm(Sender: string; Destination: string; Message: string);

{***************************************************************************}

type

  StrBuff = array[1..255] of char;

const

  LenHeaderBuff = 0;

  HeaderBuff: array[0..LenHeaderBuff] of char = ' ';

  LenTrailerBuff = 0;

  TrailerBuff: array[0..LenTrailerBuff] of char = ' ';

var

  MessageBuff: StrBuff;

  LenMessageBuff: integer;

  alpha: integer;

begin

  LenMessageBuff := length(Message);

  for alpha := 1 to LenMessageBuff do

    MessageBuff[alpha] := Message[alpha];

  DumInt := PutStream(2, HeaderBuff, LenHead