(*From: mark@devon.demon.co.uk (Mark Cross)
Subject: Re: Delphi: Serial communication???
Date: 25 May 1995 10:00:57 +0100

>>>>REPOSTED by Mark@devon.demon.co.uk
>>>>ORIGINAL written by Fred Bulback (ylwm0382@cyberstore.ca)

Someone was looking for a serial communication control, I just don't
quite remember who it was.  Hopefully this code will help him/her..
*)
(*
'------------------------------------------------------------------------------

un it Main;

int erface

use s
  Messages,WinTypes, WinProcs, Classes,
  Graphics, Forms, Controls,StdCtrls, Comm;

typ e
  T Form1 = c lass(TF orm)
    Memo1: TMemo;
    Comm1: TComm;
    procedure Memo1KeyPress(Sender: TObject; var Key: Char);
    procedure Comm1Receive(Sender: TObject; Count: Word);
  end;

va r
  Fo rm1: TForm1;

imp lementation

{ $ R *.FRM}

pr ocedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
  Comm1.Write(@Key,SizeOf(Key));
end;

pro cedure TForm1.Comm1Receive(Sender: TObject; Count: Word);
va r
  CommChar:Char;
  i:Word;
beg in
  fo r i:=1 to Count do
  beg in
    Comm1.Read(@CommChar,SizeOf(CommChar));
    PostMessage(Memo1.Handle,WM_CHAR,Word(CommChar),0);
  en d;
en d;

beg in
  R egisterClasses([TForm1, TMemo, TComm]);
  Form1 := TForm1.Create(Application);
e nd.
*)
unit Comm;

interface

implementation

end.
 