unit DataMain;
interface
uses
SysUtils, Classes, AdWnPort, OoMisc, AdPort, Dialogs;
type
TDataModMain =
class(TDataModule)
ApdComPort: TApdComPort;
ApdWinsockPort: TApdWinsockPort;
procedure ApdComPortTriggerAvail(CP: TObject; Count: Word);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
function DoCommand(CMD :
string): boolean;
end;
var
DataModMain: TDataModMain;
implementation
uses Types, Controls, FrmMain;
{$R *.dfm}
procedure TDataModMain.ApdComPortTriggerAvail(CP: TObject; Count: Word);
var I : Integer;
c : Char;
Zeile :
array[0..255]
of Char;
begin
FillChar(Zeile,SizeOf(Zeile),#0);
for i := 1
to Count
do begin
Zeile := ApdProductName;
c := ApdComPort.GetChar;
Case c
of
#10, #13 :
begin
FormMain.Memo.Lines.Add(StrPas(Zeile));
FillChar(Zeile,SizeOf(Zeile),#0);
end;
else StrCat(Zeile, PChar(c));
end;
end;
end;
function TDataModMain.DoCommand(CMD:
string): boolean;
begin
//
ApdComPort.PutString(CMD);
end;
end.