unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, Grids, DBGrids, ADODB, StdCtrls, OleCtrls, MSCommLib_TLB,
ExtCtrls;
type
Tform1 = class(TForm)
MSComm1: TMSComm;
Button1: TButton;
Label1: TLabel;
Memo1: TMemo;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Bevel1: TBevel;
Bevel2: TBevel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Edit1: TEdit;
Label12: TLabel;
Button2: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Bevel3: TBevel;
Bevel4: TBevel;
Label13: TLabel;
Bevel5: TBevel;
procedure Button1Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject
var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
form1: Tform1;
implementation
{$R *.dfm}
procedure Tform1.Button1Click(Sender: TObject);
begin
MSCOMM1.PortOpen:=TRUE;
end;
procedure Tform1.Edit1Change(Sender: TObject);
begin
IF EDIT1.TEXT<>'' THEN LABEL12.CAPTION:=FLOATTOSTR(STRTOFLOAT(EDIT1.TEXT)-STRTOFLOAT(LABEL9.CAPTION));
end;
procedure Tform1.RadioButton1Click(Sender: TObject);
begin
MSCOMM1.COMMPORT:=1
end;
procedure Tform1.RadioButton2Click(Sender: TObject);
begin
MSCOMM1.COMMPORT:=2;
end;
procedure Tform1.RadioButton3Click(Sender: TObject);
begin
MSCOMM1.COMMPORT:=3;
end;
procedure Tform1.Button2Click(Sender: TObject);
begin
mscomm1.portopen:=false;
end;
procedure Tform1.FormCreate(Sender: TObject);
begin
mscomm1.commport:=1;
RadioButton1.checked:=true;
end;
procedure Tform1.FormClose(Sender: TObject
var Action: TCloseAction);
begin
mscomm1.portopen:=false;
end;
end.