?? unitpublic.~pas
字號:
unit UnitPublic;
interface
uses
Windows, Messages, SysUtils, Variants, Classes,IniFiles;
type
TByteSend = record
StartByte:byte;
EndByte:byte;
CurByte:Byte;
CurCount:integer;
SendIntervel:integer;
SendCount:integer;
IsEnable:boolean;
end;
var
ByteSend:TByteSend;
procedure LoadByteSend;
Procedure SaveByteSend;
procedure IntSendByte;
implementation
procedure LoadByteSend;
var
CurDir:string;
iniF:TIniFile;
begin
CurDir := GetCurrentDir + '\';
iniF := TIniFile.Create(CurDir + 'CommHunter.ini');
with ByteSend do
begin
StartByte:= strtointdef('$'+iniF.ReadString('循環發送字符','StartByte','00'),$00);
EndByte:= strtointdef('$'+iniF.ReadString('循環發送字符','EndByte','FF'),$FF);
SendIntervel:=inif.ReadInteger('循環發送字符','SendIntervel',500);
SendCount:=inif.ReadInteger('循環發送字符','SendCount',1);
IsEnable:=inif.ReadBool('循環發送字符','IsEnable',false);
end;
end;
Procedure SaveByteSend;
var
CurDir:string;
iniF:TIniFile;
begin
CurDir := GetCurrentDir + '\';
iniF := TIniFile.Create(CurDir + 'CommHunter.ini');
with ByteSend do
begin
iniF.WriteString('循環發送字符','StartByte',inttohex(StartByte,2));
iniF.WriteString('循環發送字符','EndByte',inttohex(EndByte,2));
inif.WriteInteger('循環發送字符','SendIntervel',SendIntervel);
inif.WriteInteger('循環發送字符','SendCount',SendCount);
inif.WriteBool('循環發送字符','IsEnable',IsEnable);
end;
end;
procedure IntSendByte;
begin
with ByteSend do
begin
ByteSend.CurByte := ByteSend.CurByte+1;
if ByteSend.CurByte > ByteSend.EndByte then
begin
ByteSend.CurByte := ByteSend.StartByte ;
ByteSend.CurCount := ByteSend.CurCount + 1;
if ByteSend.CurCount >= ByteSend.SendCount then
begin
ByteSend.IsEnable :=false;
end;
end;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -