?? star.pas
字號:
unit Star;
interface
uses SysUtils,inifiles,forms;
const IniFileName='SunhingStar.ini';
type
TMachineInfo=Record
Com:String;
MachineStart:Integer;
MachineEnd:Integer;
end;
Procedure SetComA(IntCom:Integer);
Function HelloA:Boolean;
function SetCallNoA(DeviceNo:Integer):Boolean;
Function SetTimeA:Boolean;
Function GetRecordA(strFileName:String):Boolean;
Function SetOpenA:Boolean;
Function SetCloseA:Boolean;
Function SetNormalA:Boolean;
Function QryStatusA:Boolean;
Function SendStrA( strCommand:String):string;
Function ShowMyFormA(iParm:Integer):Boolean;
function SetOffDayA(strDays:string):Boolean;
function DeviceInitA:Boolean;
Function SetDevNoA(const intDeviceNo:Integer):Boolean;
Function GetMachineSet:TMachineInfo;
Procedure SetMachine(MachineInfo:TMachineinfo);
implementation
procedure SetCom(IntCom:Integer);stdcall;external 'kqjCom.dll';
Function Hello:Boolean;stdcall;external 'kqjCom.dll';
function SetCallNo(DeviceNo:Integer):Boolean;stdcall;external 'kqjCom.dll';
Function SetTime:Boolean;stdcall;external 'kqjCom.dll';
Function GetRecord(strFileName:String):Boolean;stdcall;external 'kqjCom.dll';
Function SetOpen:Boolean;stdcall;external 'kqjCom.dll';
Function SetClose:Boolean;stdcall;external 'kqjCom.dll';
Function SetNormal:Boolean;stdcall;external 'kqjCom.dll';
Function QryStatus:Boolean;stdcall;external 'kqjCom.dll';
Function SendStr( strCommand:String):String;stdcall; external 'kqjCom.dll';
Function ShowMyForm(iParm:Integer):Boolean;stdcall; external 'kqjCom.dll';
function SetOffDay(strDays:string):Boolean;stdcall; external 'kqjCom.dll';
function DeviceInit:Boolean;stdcall; external 'kqjCom.dll';
Function SetDevNo(intDeviceNo:Integer):Boolean;stdcall; external 'kqjCom.dll';
procedure SetComA(IntCom:Integer);
Begin
SetCom(IntCom);
end;
Function HelloA:Boolean;
Begin
Result:=Hello;
end;
function SetCallNoA(DeviceNo:Integer):Boolean;
Begin
Result:=SetCallNo(DeviceNo);
end;
Function SetTimeA:Boolean;
Begin
Result:=SetTime;
end;
Function GetRecordA(strFileName:String):Boolean;
Begin
Result:=GetRecord(strFileName);
end;
Function SetOpenA:Boolean;
Begin
Result:=SetOpen;
end;
Function SetCloseA:Boolean;
Begin
Result:=SetClose;
end;
Function SetNormalA:Boolean;
Begin
Result:=SetNormal;
end;
Function QryStatusA:Boolean;
Begin
Result:=QryStatus;
end;
Function SendStrA( strCommand:String):string;
Begin
Result:=SendStrA( strCommand);
end;
Function ShowMyFormA(iParm:Integer):Boolean;
Begin
Result:=ShowMyFormA(iParm)
end;
function SetOffDayA(strDays:string):Boolean;
Begin
Result:=SetOffDay(strDays)
end;
function DeviceInitA:Boolean;
Begin
Result:=DeviceInit;
end;
Function SetDevNoA(const intDeviceNo:Integer):Boolean;
Begin
Result:=SetDevNo(intDeviceNo)
end;
Function GetMachineSet:TMachineInfo;
var
temMachineInfo:TMachineInfo;
temIniFile:TIniFile;
begin
temIniFile:=TiniFile.Create(ExtractFileDir(application.ExeName)+'\'+IniFileName);
temMachineInfo.Com :=temIniFile.ReadString('Sunhing','Com','COM1');
temMachineInfo.MachineStart:=temIniFile.ReadInteger('Sunhing','MachineStart',1);
temMachineInfo.MachineEnd:=temIniFile.ReadInteger('Sunhing','MachineEnd',1);
teminiFile.Free;
Result:=temMachineInfo;
end;
Procedure SetMachine(MachineInfo:TMachineinfo);
var
temIniFile:TIniFile;
begin
temIniFile:=TiniFile.Create(ExtractFileDir(application.ExeName)+'\'+IniFileName);
temIniFile.WriteString('Sunhing','Com',MachineInfo.Com );
temIniFile.WriteInteger('Sunhing','MachineStart',Machineinfo.MachineStart );
temIniFile.WriteInteger('Sunhing','MachineEnd',MachineInfo.MachineEnd );
teminiFile.Free;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -